Bug 643352 keep-alive header syntax invalid r=bz
authorPatrick McManus <mcmanus@ducksong.com>
Wed, 23 Mar 2011 11:02:33 -0400
changeset 64672 6008b74c193fccd373dda83e973dbddac6f64d6a
parent 64671 77415b6ad9da8b484c1a6358802e193e2e15b201
child 64673 7fc2d583504454bd0dfd7a35b6a07670aa55639e
push idunknown
push userunknown
push dateunknown
reviewersbz
bugs643352
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 643352 keep-alive header syntax invalid r=bz don't send the keep-alive request header. It is redundant to connection: keep-alive and we don't send the right syntax anyhow.
netwerk/protocol/http/nsHttpHandler.cpp
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -389,25 +389,24 @@ nsHttpHandler::AddStandardRequestHeaders
 
     // RFC2616 section 19.6.2 states that the "Connection: keep-alive"
     // and "Keep-alive" request headers should not be sent by HTTP/1.1
     // user-agents.  Otherwise, problems with proxy servers (especially
     // transparent proxies) can result.
     //
     // However, we need to send something so that we can use keepalive
     // with HTTP/1.0 servers/proxies. We use "Proxy-Connection:" when 
-    // we're talking to an http proxy, and "Connection:" otherwise
+    // we're talking to an http proxy, and "Connection:" otherwise.
+    // We no longer send the Keep-Alive request header.
     
     NS_NAMED_LITERAL_CSTRING(close, "close");
     NS_NAMED_LITERAL_CSTRING(keepAlive, "keep-alive");
 
     const nsACString *connectionType = &close;
     if (caps & NS_HTTP_ALLOW_KEEPALIVE) {
-        rv = request->SetHeader(nsHttp::Keep_Alive, nsPrintfCString("%u", mIdleTimeout));
-        if (NS_FAILED(rv)) return rv;
         connectionType = &keepAlive;
     } else if (useProxy) {
         // Bug 92006
         request->SetHeader(nsHttp::Connection, close);
     }
 
     // Add the "Do-Not-Track" header
     if (mDoNotTrackEnabled) {