Chromium Code Reviews| Index: net/quic/quic_chromium_client_session.cc |
| diff --git a/net/quic/quic_chromium_client_session.cc b/net/quic/quic_chromium_client_session.cc |
| index 78044e810cd85da5ab136382fcabdf956d98836b..206c67f7068237f6a744f19d9d4bc50b0e85693c 100644 |
| --- a/net/quic/quic_chromium_client_session.cc |
| +++ b/net/quic/quic_chromium_client_session.cc |
| @@ -58,7 +58,8 @@ enum Location { |
| CREATE_OUTGOING_RELIABLE_STREAM = 3, |
| NOTIFY_FACTORY_OF_SESSION_CLOSED_LATER = 4, |
| NOTIFY_FACTORY_OF_SESSION_CLOSED = 5, |
| - NUM_LOCATIONS = 6, |
| + CREATE_INCOMING_RELIABLE_STREAM = 6, |
|
Ryan Hamilton
2016/02/29 17:49:40
I think you can get rid of this change now?
Buck
2016/02/29 19:03:01
Done.
|
| + NUM_LOCATIONS = 7, |
| }; |
| void RecordUnexpectedOpenStreams(Location location) { |
| @@ -577,10 +578,37 @@ bool QuicChromiumClientSession::CanPool(const std::string& hostname, |
| server_id_.host(), hostname); |
| } |
| -QuicSpdyStream* QuicChromiumClientSession::CreateIncomingDynamicStream( |
| - QuicStreamId id) { |
| - DLOG(ERROR) << "Server push not supported"; |
| - return nullptr; |
| +QuicChromiumClientStream* |
| +QuicChromiumClientSession::CreateIncomingDynamicStream(QuicStreamId id) { |
| + if (!connection()->connected()) { |
| + LOG(DFATAL) << "ShouldCreateIncomingDynamicStream called when disconnected"; |
| + return nullptr; |
| + } |
| + if (goaway_received()) { |
| + DVLOG(1) << "Failed to create a new outgoing stream. " |
| + << "Already received goaway."; |
| + return nullptr; |
| + } |
| + if (going_away_) { |
| + return nullptr; |
| + } |
| + if (id % 2 != 0) { |
| + LOG(WARNING) << "Received invalid push stream id " << id; |
| + connection()->SendConnectionCloseWithDetails( |
| + QUIC_INVALID_STREAM_ID, "Server created odd numbered stream"); |
| + return nullptr; |
| + } |
| + return CreateIncomingReliableStreamImpl(id); |
| +} |
| + |
| +QuicChromiumClientStream* |
| +QuicChromiumClientSession::CreateIncomingReliableStreamImpl(QuicStreamId id) { |
| + DCHECK(connection()->connected()); |
| + QuicChromiumClientStream* stream = |
| + new QuicChromiumClientStream(id, this, net_log_); |
| + stream->CloseWriteSide(); |
| + ++num_total_streams_; |
| + return stream; |
| } |
| void QuicChromiumClientSession::CloseStream(QuicStreamId stream_id) { |