diff options
-rw-r--r-- | chrome/browser/sync/engine/net/server_connection_manager.cc | 28 | ||||
-rw-r--r-- | chrome/browser/sync/engine/net/server_connection_manager.h | 10 |
2 files changed, 2 insertions, 36 deletions
diff --git a/chrome/browser/sync/engine/net/server_connection_manager.cc b/chrome/browser/sync/engine/net/server_connection_manager.cc index bceb187..b0d7c2f 100644 --- a/chrome/browser/sync/engine/net/server_connection_manager.cc +++ b/chrome/browser/sync/engine/net/server_connection_manager.cc @@ -180,7 +180,6 @@ ServerConnectionManager::ServerConnectionManager( use_ssl_(use_ssl), proto_sync_path_(kSyncServerSyncPath), get_time_path_(kSyncServerGetTimePath), - error_count_(0), server_status_(HttpResponse::NONE), server_reachable_(false), terminated_(false), @@ -252,14 +251,11 @@ bool ServerConnectionManager::PostBufferToPath(PostBufferParams* params, bool ok = post.get()->Init( path.c_str(), auth_token, params->buffer_in, ¶ms->response); - if (params->response.server_status == HttpResponse::SYNC_AUTH_ERROR) { + if (params->response.server_status == HttpResponse::SYNC_AUTH_ERROR) InvalidateAndClearAuthToken(); - } - if (!ok || RC_REQUEST_OK != params->response.response_code) { - IncrementErrorCount(); + if (!ok || RC_REQUEST_OK != params->response.response_code) return false; - } if (post.get()->ReadBufferResponse( ¶ms->buffer_out, ¶ms->response, true)) { @@ -311,7 +307,6 @@ bool ServerConnectionManager::CheckTime(int32* out_time) { VLOG(1) << "Server was reachable."; return true; } - IncrementErrorCount(); return false; } @@ -336,25 +331,6 @@ bool ServerConnectionManager::CheckServerReachable() { return server_is_reachable; } -bool ServerConnectionManager::IncrementErrorCount() { - DCHECK(thread_checker_.CalledOnValidThread()); - error_count_++; - - if (error_count_ > kMaxConnectionErrorsBeforeReset) { - error_count_ = 0; - - if (!IsServerReachable()) { - LOG(WARNING) << "Too many connection failures, server is not reachable. " - << "Resetting connections."; - } else { - LOG(WARNING) << "Multiple connection failures while server is reachable."; - } - return false; - } - - return true; -} - void ServerConnectionManager::SetServerParameters(const string& server_url, int port, bool use_ssl) { diff --git a/chrome/browser/sync/engine/net/server_connection_manager.h b/chrome/browser/sync/engine/net/server_connection_manager.h index ae53a37..748c3f7 100644 --- a/chrome/browser/sync/engine/net/server_connection_manager.h +++ b/chrome/browser/sync/engine/net/server_connection_manager.h @@ -31,10 +31,6 @@ namespace browser_sync { class ClientToServerMessage; -// How many connection errors are accepted before network handles are closed -// and reopened. -static const int32 kMaxConnectionErrorsBeforeReset = 10; - static const int32 kUnsetResponseCode = -1; static const int32 kUnsetContentLength = -1; static const int32 kUnsetPayloadLength = -1; @@ -299,10 +295,6 @@ class ServerConnectionManager { return get_time_path_; } - // Called wherever a failure should be taken as an indication that we may - // be experiencing connection difficulties. - virtual bool IncrementErrorCount(); - // NOTE: Tests rely on this protected function being virtual. // // Internal PostBuffer base function. @@ -345,8 +337,6 @@ class ServerConnectionManager { // The previous auth token that is invalid now. std::string previously_invalidated_token; - int error_count_; // Tracks the number of connection errors. - ObserverList<ServerConnectionEventListener> listeners_; HttpResponse::ServerConnectionCode server_status_; |