Index: net/quic/quic_http_stream.cc |
diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc |
index 56dbbab13e564fb593930ae918a52fad741e7ef1..00ff7733d5634425792b4bc2740f20c2452c26b9 100644 |
--- a/net/quic/quic_http_stream.cc |
+++ b/net/quic/quic_http_stream.cc |
@@ -406,16 +406,17 @@ int QuicHttpStream::DoSendHeaders() { |
if (!stream_) |
return ERR_UNEXPECTED; |
- if (request_.empty() && !stream_->CanWrite( |
- base::Bind(&QuicHttpStream::OnIOComplete, |
- weak_factory_.GetWeakPtr()))) { |
- // Do not compress headers unless it is likely that they can be sent. |
- next_state_ = STATE_SEND_HEADERS; |
- return ERR_IO_PENDING; |
+ if (stream_->version() <= QUIC_VERSION_12) { |
+ if (request_.empty() && !stream_->CanWrite( |
+ base::Bind(&QuicHttpStream::OnIOComplete, |
+ weak_factory_.GetWeakPtr()))) { |
+ // Do not compress headers unless it is likely that they can be sent. |
+ next_state_ = STATE_SEND_HEADERS; |
+ return ERR_IO_PENDING; |
+ } |
+ request_ = stream_->compressor()->CompressHeadersWithPriority( |
+ ConvertRequestPriorityToQuicPriority(priority_), request_headers_); |
} |
- request_ = stream_->compressor()->CompressHeadersWithPriority( |
- ConvertRequestPriorityToQuicPriority(priority_), request_headers_); |
- |
// Log the actual request with the URL Request's net log. |
stream_net_log_.AddEvent( |
NetLog::TYPE_HTTP_TRANSACTION_SPDY_SEND_REQUEST_HEADERS, |
@@ -424,14 +425,17 @@ int QuicHttpStream::DoSendHeaders() { |
stream_->net_log().AddEvent( |
NetLog::TYPE_QUIC_HTTP_STREAM_SEND_REQUEST_HEADERS, |
base::Bind(&SpdyHeaderBlockNetLogCallback, &request_headers_)); |
- request_headers_.clear(); |
bool has_upload_data = request_body_stream_ != NULL; |
next_state_ = STATE_SEND_HEADERS_COMPLETE; |
- return stream_->WriteStreamData( |
- request_, !has_upload_data, |
- base::Bind(&QuicHttpStream::OnIOComplete, weak_factory_.GetWeakPtr())); |
+ int rv = (stream_->version() > QUIC_VERSION_12) ? |
+ stream_->WriteHeaders(request_headers_, !has_upload_data) : |
+ stream_->WriteStreamData(request_, !has_upload_data, |
+ base::Bind(&QuicHttpStream::OnIOComplete, |
+ weak_factory_.GetWeakPtr())); |
+ request_headers_.clear(); |
+ return rv; |
} |
int QuicHttpStream::DoSendHeadersComplete(int rv) { |