Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: net/spdy/spdy_http_stream.cc

Issue 492063002: Allow SPDY POSTs to be terminated by an empty FIN data frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/spdy_http_stream.h" 5 #include "net/spdy/spdy_http_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 // ERR_IO_PENDING is the only possible error. 417 // ERR_IO_PENDING is the only possible error.
418 CHECK_GE(rv, 0); 418 CHECK_GE(rv, 0);
419 OnRequestBodyReadCompleted(rv); 419 OnRequestBodyReadCompleted(rv);
420 } 420 }
421 } 421 }
422 422
423 void SpdyHttpStream::OnRequestBodyReadCompleted(int status) { 423 void SpdyHttpStream::OnRequestBodyReadCompleted(int status) {
424 CHECK_GE(status, 0); 424 CHECK_GE(status, 0);
425 request_body_buf_size_ = status; 425 request_body_buf_size_ = status;
426 const bool eof = request_info_->upload_data_stream->IsEOF(); 426 const bool eof = request_info_->upload_data_stream->IsEOF();
427 // Only the final fame may have a length of 0.
427 if (eof) { 428 if (eof) {
428 CHECK_GE(request_body_buf_size_, 0); 429 CHECK_GE(request_body_buf_size_, 0);
429 } else { 430 } else {
430 CHECK_GT(request_body_buf_size_, 0); 431 CHECK_GT(request_body_buf_size_, 0);
431 } 432 }
432 stream_->SendData(request_body_buf_.get(), 433 stream_->SendData(request_body_buf_.get(),
433 request_body_buf_size_, 434 request_body_buf_size_,
434 eof ? NO_MORE_DATA_TO_SEND : MORE_DATA_TO_SEND); 435 eof ? NO_MORE_DATA_TO_SEND : MORE_DATA_TO_SEND);
435 } 436 }
436 437
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 Close(false); 529 Close(false);
529 delete this; 530 delete this;
530 } 531 }
531 532
532 void SpdyHttpStream::SetPriority(RequestPriority priority) { 533 void SpdyHttpStream::SetPriority(RequestPriority priority) {
533 // TODO(akalin): Plumb this through to |stream_request_| and 534 // TODO(akalin): Plumb this through to |stream_request_| and
534 // |stream_|. 535 // |stream_|.
535 } 536 }
536 537
537 } // namespace net 538 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/spdy/spdy_http_stream_unittest.cc » ('j') | net/spdy/spdy_http_stream_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698