| Index: net/spdy/spdy_framer.cc
|
| diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
|
| index c51ea5842e800c94b95eca0ae19b951bdbe141f8..dfafd514338db8adac1b68872544dfc18331a14e 100644
|
| --- a/net/spdy/spdy_framer.cc
|
| +++ b/net/spdy/spdy_framer.cc
|
| @@ -14,6 +14,7 @@
|
| #include "base/lazy_instance.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/metrics/histogram_macros.h"
|
| +#include "net/quic/quic_flags.h"
|
| #include "net/spdy/hpack/hpack_constants.h"
|
| #include "net/spdy/spdy_frame_builder.h"
|
| #include "net/spdy/spdy_frame_reader.h"
|
| @@ -171,7 +172,8 @@ SpdyFramer::SpdyFramer(SpdyMajorVersion version)
|
| enable_compression_(true),
|
| syn_frame_processed_(false),
|
| probable_http_response_(false),
|
| - end_stream_when_done_(false) {
|
| + end_stream_when_done_(false),
|
| + spdy_on_stream_end_(FLAGS_spdy_on_stream_end) {
|
| DCHECK(protocol_version_ == SPDY3 || protocol_version_ == HTTP2);
|
| DCHECK_LE(kMaxControlFrameSize,
|
| SpdyConstants::GetFrameMaximumSize(protocol_version_) +
|
| @@ -830,8 +832,12 @@ size_t SpdyFramer::ProcessCommonHeader(const char* data, size_t len) {
|
| } else {
|
| // Empty data frame.
|
| if (current_frame_flags_ & DATA_FLAG_FIN) {
|
| - visitor_->OnStreamFrameData(
|
| - current_frame_stream_id_, NULL, 0, true);
|
| + if (spdy_on_stream_end_) {
|
| + visitor_->OnStreamEnd(current_frame_stream_id_);
|
| + } else {
|
| + visitor_->OnStreamFrameData(current_frame_stream_id_, nullptr, 0,
|
| + true);
|
| + }
|
| }
|
| CHANGE_STATE(SPDY_FRAME_COMPLETE);
|
| }
|
| @@ -2110,7 +2116,11 @@ size_t SpdyFramer::ProcessFramePadding(const char* data, size_t len) {
|
| ((current_frame_flags_ & CONTROL_FLAG_FIN) != 0 ||
|
| end_stream_when_done_)) {
|
| end_stream_when_done_ = false;
|
| - visitor_->OnStreamFrameData(current_frame_stream_id_, NULL, 0, true);
|
| + if (spdy_on_stream_end_) {
|
| + visitor_->OnStreamEnd(current_frame_stream_id_);
|
| + } else {
|
| + visitor_->OnStreamFrameData(current_frame_stream_id_, nullptr, 0, true);
|
| + }
|
| }
|
| CHANGE_STATE(SPDY_FRAME_COMPLETE);
|
| }
|
|
|