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

Side by Side Diff: net/socket/tcp_client_socket_libevent.cc

Issue 3976004: Adds a new error for cases where a firewall may be the issue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/tcp_client_socket_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/tcp_client_socket_libevent.h" 5 #include "net/socket/tcp_client_socket_libevent.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <netdb.h> 9 #include <netdb.h>
10 #include <sys/socket.h> 10 #include <sys/socket.h>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return OK; 79 return OK;
80 default: 80 default:
81 LOG(WARNING) << "Unknown error " << os_error 81 LOG(WARNING) << "Unknown error " << os_error
82 << " mapped to net::ERR_FAILED"; 82 << " mapped to net::ERR_FAILED";
83 return ERR_FAILED; 83 return ERR_FAILED;
84 } 84 }
85 } 85 }
86 86
87 int MapConnectError(int os_error) { 87 int MapConnectError(int os_error) {
88 switch (os_error) { 88 switch (os_error) {
89 case EACCES:
90 return ERR_NETWORK_ACCESS_DENIED;
89 case ETIMEDOUT: 91 case ETIMEDOUT:
90 return ERR_CONNECTION_TIMED_OUT; 92 return ERR_CONNECTION_TIMED_OUT;
91 default: { 93 default: {
92 int net_error = MapPosixError(os_error); 94 int net_error = MapPosixError(os_error);
93 if (net_error == ERR_FAILED) 95 if (net_error == ERR_FAILED)
94 return ERR_CONNECTION_FAILED; // More specific than ERR_FAILED. 96 return ERR_CONNECTION_FAILED; // More specific than ERR_FAILED.
95 97
96 // Give a more specific error when the user is offline. 98 // Give a more specific error when the user is offline.
97 if (net_error == ERR_ADDRESS_UNREACHABLE && 99 if (net_error == ERR_ADDRESS_UNREACHABLE &&
98 NetworkChangeNotifier::IsOffline()) { 100 NetworkChangeNotifier::IsOffline()) {
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 549
548 void TCPClientSocketLibevent::SetOmniboxSpeculation() { 550 void TCPClientSocketLibevent::SetOmniboxSpeculation() {
549 use_history_.set_omnibox_speculation(); 551 use_history_.set_omnibox_speculation();
550 } 552 }
551 553
552 bool TCPClientSocketLibevent::WasEverUsed() const { 554 bool TCPClientSocketLibevent::WasEverUsed() const {
553 return use_history_.was_used_to_convey_data(); 555 return use_history_.was_used_to_convey_data();
554 } 556 }
555 557
556 } // namespace net 558 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_nss.cc ('k') | net/socket/tcp_client_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698