Comment #5 on issue 30469 by [email protected]: HttpNetworkTransaction should not return net::OK when the connection is closed.
http://code.google.com/p/chromium/issues/detail?id=30469

rvargas: you mean HttpNetworkTransaction::Read() returns 0 (synchronously
or asynchronously via the completion callback) if the connection is closed
gracefully before we have read the entire content length?  Based on code
inspection, I believe this is the case:

int HttpNetworkTransaction::DoReadBodyComplete(int result) {
  // We are done with the Read call.
  DCHECK(!establishing_tunnel_) <<
      "We should never read a response body of a tunnel.";

  bool done = false, keep_alive = false;
  if (result < 0) {
    // Error or closed connection while reading the socket.
    done = true;
// TODO(wtc): Traditionally this code has returned 0 when reading a closed
    // socket.  That is partially corrected in classes that we call, but
    // callers need to be updated.
    if (result == ERR_CONNECTION_CLOSED) <=== HERE
      result = 0;
  } else if (http_stream_->IsResponseBodyComplete()) {
    done = true;
    keep_alive = GetResponseHeaders()->IsKeepAlive();
  }

Perhaps we should add an ERR_TRUNCATED_RESPONSE error code,
and return that error if http_stream_->IsResponseBodyComplete()
is false when 'result' is ERR_CONNECTION_CLOSED?

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
-- 
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs

Reply via email to