Chromium Code Reviews

Unified Diff: net/spdy/spdy_http_stream.cc

Issue 2064593002: Change SPDY to call request_callback after data is sent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | net/spdy/spdy_http_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_http_stream.cc
diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc
index 259581a5229173cc2e7fcbc84963396f357c0d80..776c437ab23a131e14791c85bb2349c352c45b25 100644
--- a/net/spdy/spdy_http_stream.cc
+++ b/net/spdy/spdy_http_stream.cc
@@ -302,13 +302,14 @@ void SpdyHttpStream::Cancel() {
}
void SpdyHttpStream::OnRequestHeadersSent() {
- if (!request_callback_.is_null())
- DoRequestCallback(OK);
-
// TODO(akalin): Do this immediately after sending the request
Bence 2016/06/13 13:53:36 I do not exactly understand this TODO, but my impr
maksims (do not use this acc) 2016/06/15 07:51:45 Done.
// headers.
- if (HasUploadData())
+ if (HasUploadData()) {
ReadAndSendRequestBodyData();
+ } else {
+ if (!request_callback_.is_null())
+ DoRequestCallback(OK);
+ }
}
SpdyResponseHeadersStatus SpdyHttpStream::OnResponseHeadersUpdated(
@@ -467,6 +468,9 @@ void SpdyHttpStream::OnRequestBodyReadCompleted(int status) {
stream_->SendData(request_body_buf_.get(),
request_body_buf_size_,
eof ? NO_MORE_DATA_TO_SEND : MORE_DATA_TO_SEND);
+
+ if (!request_callback_.is_null())
+ DoRequestCallback(OK);
mmenke 2016/06/13 14:31:06 BUG: Shouldn't we only do this if eof is true?
mmenke 2016/06/13 14:48:27 Actually, that's not enough. ReadAndSendRequestBo
maksims (do not use this acc) 2016/06/14 08:35:03 Oh,oh, my mistake. I haven't noticed that. I check
mmenke 2016/06/14 15:25:44 This one.... If request_info_->upload_data_stream
maksims (do not use this acc) 2016/06/15 07:51:45 As I said if I call OnRequestBodyReadCompleted fro
}
void SpdyHttpStream::ScheduleBufferedReadCallback() {
« no previous file with comments | « no previous file | net/spdy/spdy_http_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine