Index: chrome/browser/sync/engine/net/server_connection_manager.cc |
diff --git a/chrome/browser/sync/engine/net/server_connection_manager.cc b/chrome/browser/sync/engine/net/server_connection_manager.cc |
index ef45722356214e13efaa43e0d4727027c32292d4..fe9542de7dab217e1bb9d287974c04f056b43d50 100644 |
--- a/chrome/browser/sync/engine/net/server_connection_manager.cc |
+++ b/chrome/browser/sync/engine/net/server_connection_manager.cc |
@@ -192,11 +192,21 @@ bool ServerConnectionManager::PostBufferToPath(const PostBufferParams* params, |
const string& path, const string& auth_token, |
ScopedServerStatusWatcher* watcher) { |
DCHECK(watcher != NULL); |
+ |
+ if (auth_token.empty()) { |
+ params->response->server_status = HttpResponse::SYNC_AUTH_ERROR; |
+ return false; |
+ } |
+ |
scoped_ptr<Post> post(MakePost()); |
post->set_timing_info(params->timing_info); |
bool ok = post->Init(path.c_str(), auth_token, params->buffer_in, |
params->response); |
+ if (params->response->server_status == HttpResponse::SYNC_AUTH_ERROR) { |
+ InvalidateAndClearAuthToken(); |
+ } |
+ |
if (!ok || RC_REQUEST_OK != params->response->response_code) { |
IncrementErrorCount(); |
return false; |