Index: net/spdy/spdy_http_stream.cc |
=================================================================== |
--- net/spdy/spdy_http_stream.cc (revision 80449) |
+++ net/spdy/spdy_http_stream.cc (working copy) |
@@ -340,10 +340,28 @@ |
} |
void SpdyHttpStream::OnDataReceived(const char* data, int length) { |
+ // JTL - delete this |
+ if (using_sctp()) { |
+ if (!using_sctp_control_stream() || stream()->syn_reply_received()) { |
+ printf("SpdyHttpStream::OnDataReceived: entered on stream %d " |
+ "(length = %d)\n", |
+ stream()->stream_id(), length); |
+ } else { |
+ printf("SpdyHttpStream::OnDataReceived: entered on stream %d, with " |
+ "syn_reply_received_ = false (length = %d)\n", |
+ stream()->stream_id(), length); |
+ } |
+ } |
// SpdyStream won't call us with data if the header block didn't contain a |
// valid set of headers. So we don't expect to not have headers received |
// here. |
- DCHECK(response_headers_received_); |
+ // Exception - when using SCTP with a single dictionary, all SPDY CONTROL |
+ // frames are sent on SCTP stream 0, while all SPDY DATA frames are sent on |
+ // SCTP stream n > 0. This means that data can arrive before a SYN_REPLY, |
+ // due to reordering or loss. In this case we can't require |
+ // response_headers_received to be true. |
+ if ( !(using_sctp() && using_sctp_control_stream())) |
+ DCHECK(response_headers_received_); |
// Note that data may be received for a SpdyStream prior to the user calling |
// ReadResponseBody(), therefore user_buffer_ may be NULL. This may often |
@@ -382,6 +400,11 @@ |
void SpdyHttpStream::ScheduleBufferedReadCallback() { |
// If there is already a scheduled DoBufferedReadCallback, don't issue |
// another one. Mark that we have received more data and return. |
+ if (using_sctp() && using_sctp_control_stream() && |
+ !stream()->syn_reply_received()) { |
+ printf("SpdyHttpStream::ScheduleBufferedReadCallback: SYN_REPLY is " |
+ "*** pending *** on stream %d\n", stream()->stream_id()); // JTL |
+ } |
if (buffered_read_callback_pending_) { |
more_read_data_pending_ = true; |
return; |