Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2649)

Unified Diff: net/http/http_network_transaction.h

Issue 21433: Perform HTTP authentication over a keep-alive connection.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Last upload before checkin Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/http/http_network_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.h
===================================================================
--- net/http/http_network_transaction.h (revision 9963)
+++ net/http/http_network_transaction.h (working copy)
@@ -75,6 +75,8 @@
int DoReadHeadersComplete(int result);
int DoReadBody();
int DoReadBodyComplete(int result);
+ int DoDrainBodyForAuthRestart();
+ int DoDrainBodyForAuthRestartComplete(int result);
// Record histogram of latency (first byte sent till last byte received) as
// well as effective bandwidth used.
@@ -126,6 +128,11 @@
// Sets up the state machine to restart the transaction with auth.
void PrepareForAuthRestart(HttpAuth::Target target);
+ // Called when we don't need to drain the response body or have drained it.
+ // Resets |connection_| unless |keep_alive| is true, then calls
+ // ResetStateForRestart. Sets |next_state_| appropriately.
+ void DidDrainBodyForAuthRestart(bool keep_alive);
+
// Resets the members of the transaction so it can be restarted.
void ResetStateForRestart();
@@ -245,6 +252,11 @@
// Note: |kMaxHeaderBufSize| should be a multiple of |kHeaderBufInitialSize|.
enum { kMaxHeaderBufSize = 32768 }; // 32 kilobytes.
+ // The size in bytes of the buffer we use to drain the response body that
+ // we want to throw away. The response body is typically a small error
+ // page just a few hundred bytes long.
+ enum { kDrainBodyBufferSize = 1024 };
+
// The position where status line starts; -1 if not found yet.
int header_buf_http_offset_;
@@ -281,6 +293,8 @@
STATE_READ_HEADERS_COMPLETE,
STATE_READ_BODY,
STATE_READ_BODY_COMPLETE,
+ STATE_DRAIN_BODY_FOR_AUTH_RESTART,
+ STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE,
STATE_NONE
};
State next_state_;
« no previous file with comments | « no previous file | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698