From c391e78224fccd37c5d3d7f90309a86b8f384793 Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Thu, 15 Sep 2011 14:10:54 +0100 Subject: Fix for bug 5226268 [Browser] http keep-alive DO NOT MERGE Disabling connection reuse so we can disable keep-alives. Needs a CL from external/webkit: https://android-git.corp.google.com/g/#/c/135470/ Change-Id: If8cdfb2c1686d8c971f6025b1e9ae75f57dd7f16 --- net/http/http_basic_stream.cc | 6 ++++++ net/socket/tcp_client_socket_libevent.cc | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/net/http/http_basic_stream.cc b/net/http/http_basic_stream.cc index 6501a59..076d18f 100644 --- a/net/http/http_basic_stream.cc +++ b/net/http/http_basic_stream.cc @@ -72,7 +72,13 @@ int HttpBasicStream::ReadResponseBody(IOBuffer* buf, int buf_len, } void HttpBasicStream::Close(bool not_reusable) { +#ifdef ANDROID + // Disable connection reuse for bug 5226268 + // [Browser] http keep-alive packets are sent too frequently to network + parser_->Close(true); +#else parser_->Close(not_reusable); +#endif } HttpStream* HttpBasicStream::RenewStreamForAuth() { diff --git a/net/socket/tcp_client_socket_libevent.cc b/net/socket/tcp_client_socket_libevent.cc index ed9d87d..f820955 100644 --- a/net/socket/tcp_client_socket_libevent.cc +++ b/net/socket/tcp_client_socket_libevent.cc @@ -528,7 +528,12 @@ int TCPClientSocketLibevent::SetupSocket() { // This mirrors the behaviour on Windows. See the comment in // tcp_client_socket_win.cc after searching for "NODELAY". DisableNagle(socket_); // If DisableNagle fails, we don't care. + + // ANDROID: Disable TCP keep-alive for bug 5226268 + // [Browser] http keep-alive packets are sent too frequently to network +#ifndef ANDROID SetTCPKeepAlive(socket_); +#endif #ifdef ANDROID if (valid_uid_) -- cgit v1.1