OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #endif | 45 #endif |
46 return ERR_IO_PENDING; | 46 return ERR_IO_PENDING; |
47 case EACCES: | 47 case EACCES: |
48 return ERR_ACCESS_DENIED; | 48 return ERR_ACCESS_DENIED; |
49 case ENETDOWN: | 49 case ENETDOWN: |
50 return ERR_INTERNET_DISCONNECTED; | 50 return ERR_INTERNET_DISCONNECTED; |
51 case ETIMEDOUT: | 51 case ETIMEDOUT: |
52 return ERR_TIMED_OUT; | 52 return ERR_TIMED_OUT; |
53 case ECONNRESET: | 53 case ECONNRESET: |
54 case ENETRESET: // Related to keep-alive | 54 case ENETRESET: // Related to keep-alive |
| 55 case EPIPE: |
55 return ERR_CONNECTION_RESET; | 56 return ERR_CONNECTION_RESET; |
56 case ECONNABORTED: | 57 case ECONNABORTED: |
57 return ERR_CONNECTION_ABORTED; | 58 return ERR_CONNECTION_ABORTED; |
58 case ECONNREFUSED: | 59 case ECONNREFUSED: |
59 return ERR_CONNECTION_REFUSED; | 60 return ERR_CONNECTION_REFUSED; |
60 case EHOSTUNREACH: | 61 case EHOSTUNREACH: |
61 case ENETUNREACH: | 62 case ENETUNREACH: |
62 return ERR_ADDRESS_UNREACHABLE; | 63 return ERR_ADDRESS_UNREACHABLE; |
63 case EADDRNOTAVAIL: | 64 case EADDRNOTAVAIL: |
64 return ERR_ADDRESS_INVALID; | 65 return ERR_ADDRESS_INVALID; |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 DoWriteCallback(result); | 446 DoWriteCallback(result); |
446 } | 447 } |
447 } | 448 } |
448 | 449 |
449 int TCPClientSocketLibevent::GetPeerName(struct sockaddr* name, | 450 int TCPClientSocketLibevent::GetPeerName(struct sockaddr* name, |
450 socklen_t* namelen) { | 451 socklen_t* namelen) { |
451 return ::getpeername(socket_, name, namelen); | 452 return ::getpeername(socket_, name, namelen); |
452 } | 453 } |
453 | 454 |
454 } // namespace net | 455 } // namespace net |
OLD | NEW |