Index: net/cert_net/nss_ocsp.cc |
diff --git a/net/cert_net/nss_ocsp.cc b/net/cert_net/nss_ocsp.cc |
index 46000565fe1eeae65f216f386aedfcc38709e896..ff82eeeeaba17c7fb0eb6138c665274ba814a2ba 100644 |
--- a/net/cert_net/nss_ocsp.cc |
+++ b/net/cert_net/nss_ocsp.cc |
@@ -299,16 +299,17 @@ class OCSPRequestSession |
} |
} |
- void OnResponseStarted(URLRequest* request) override { |
+ void OnResponseStarted(URLRequest* request, int net_error) override { |
DCHECK_EQ(request_.get(), request); |
DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_); |
+ DCHECK_NE(ERR_IO_PENDING, net_error); |
int bytes_read = 0; |
- if (request->status().is_success()) { |
+ if (net_error == OK) { |
response_code_ = request_->GetResponseCode(); |
response_headers_ = request_->response_headers(); |
response_headers_->GetMimeType(&response_content_type_); |
- request_->Read(buffer_.get(), kRecvBufferSize, &bytes_read); |
+ bytes_read = request_->Read(buffer_.get(), kRecvBufferSize); |
} |
OnReadCompleted(request_.get(), bytes_read); |
} |
@@ -318,12 +319,13 @@ class OCSPRequestSession |
DCHECK_EQ(base::MessageLoopForIO::current(), io_loop_); |
do { |
- if (!request_->status().is_success() || bytes_read <= 0) |
+ if (bytes_read <= 0) |
break; |
data_.append(buffer_->data(), bytes_read); |
- } while (request_->Read(buffer_.get(), kRecvBufferSize, &bytes_read)); |
+ bytes_read = request_->Read(buffer_.get(), kRecvBufferSize); |
+ } while (bytes_read > 0); |
mmenke
2016/08/30 22:13:22
This final while condition is no longer needed. T
maksims (do not use this acc)
2016/09/01 12:22:29
Done!
|
- if (!request_->status().is_io_pending()) { |
+ if (bytes_read != ERR_IO_PENDING) { |
request_.reset(); |
g_ocsp_io_loop.Get().RemoveRequest(this); |
{ |