OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/base/net_errors.h" | 5 #include "net/base/net_errors.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string> | 9 #include <string> |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 case EHOSTDOWN: | 44 case EHOSTDOWN: |
45 case ENETUNREACH: | 45 case ENETUNREACH: |
46 case EAFNOSUPPORT: | 46 case EAFNOSUPPORT: |
47 return ERR_ADDRESS_UNREACHABLE; | 47 return ERR_ADDRESS_UNREACHABLE; |
48 case EADDRNOTAVAIL: | 48 case EADDRNOTAVAIL: |
49 return ERR_ADDRESS_INVALID; | 49 return ERR_ADDRESS_INVALID; |
50 case EMSGSIZE: | 50 case EMSGSIZE: |
51 return ERR_MSG_TOO_BIG; | 51 return ERR_MSG_TOO_BIG; |
52 case ENOTCONN: | 52 case ENOTCONN: |
53 return ERR_SOCKET_NOT_CONNECTED; | 53 return ERR_SOCKET_NOT_CONNECTED; |
| 54 case EISCONN: |
| 55 return ERR_SOCKET_IS_CONNECTED; |
54 case EINVAL: | 56 case EINVAL: |
55 return ERR_INVALID_ARGUMENT; | 57 return ERR_INVALID_ARGUMENT; |
56 case EADDRINUSE: | 58 case EADDRINUSE: |
57 return ERR_ADDRESS_IN_USE; | 59 return ERR_ADDRESS_IN_USE; |
58 case E2BIG: // Argument list too long. | 60 case E2BIG: // Argument list too long. |
59 return ERR_INVALID_ARGUMENT; | 61 return ERR_INVALID_ARGUMENT; |
60 case EBADF: // Bad file descriptor. | 62 case EBADF: // Bad file descriptor. |
61 return ERR_INVALID_HANDLE; | 63 return ERR_INVALID_HANDLE; |
62 case EBUSY: // Device or resource busy. | 64 case EBUSY: // Device or resource busy. |
63 return ERR_INSUFFICIENT_RESOURCES; | 65 return ERR_INSUFFICIENT_RESOURCES; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 case 0: | 113 case 0: |
112 return OK; | 114 return OK; |
113 default: | 115 default: |
114 LOG(WARNING) << "Unknown error " << os_error | 116 LOG(WARNING) << "Unknown error " << os_error |
115 << " mapped to net::ERR_FAILED"; | 117 << " mapped to net::ERR_FAILED"; |
116 return ERR_FAILED; | 118 return ERR_FAILED; |
117 } | 119 } |
118 } | 120 } |
119 | 121 |
120 } // namespace net | 122 } // namespace net |
OLD | NEW |