Chromium Code Reviews| Index: webkit/glue/multipart_response_delegate.cc |
| diff --git a/webkit/glue/multipart_response_delegate.cc b/webkit/glue/multipart_response_delegate.cc |
| index 8de6469fb584036d703e489df7745e3450a31fd2..ca35a5aa9594460aa32ba3680133124e89511fb7 100644 |
| --- a/webkit/glue/multipart_response_delegate.cc |
| +++ b/webkit/glue/multipart_response_delegate.cc |
| @@ -149,6 +149,18 @@ void MultipartResponseDelegate::OnReceivedData(const char* data, |
| break; |
| } |
| } |
| + |
| + // At this point, we should send over any data we have, but keep enough data |
| + // buffered to handle a boundary that may have been truncated. |
| + if (!processing_headers_ && data_.length() > boundary_.length()) { |
| + // If the last character is a new line character, go ahead and just send |
| + // everything we have buffered. This matches an optimization in Gecko. |
| + int send_length = data_.length() - boundary_.length(); |
| + if (data_[data_.length() - 1] == '\n') |
| + send_length = data_.length(); |
|
darin (slow to review)
2010/05/18 15:46:10
nit: indentation
|
| + client_->didReceiveData(loader_, data_.data(), send_length); |
| + data_ = data_.substr(send_length); |
| + } |
| } |
| void MultipartResponseDelegate::OnCompletedRequest() { |