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 <winsock2.h> | 7 #include <winsock2.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... | |
38 case WSAEDISCON: | 38 case WSAEDISCON: |
39 return ERR_CONNECTION_CLOSED; | 39 return ERR_CONNECTION_CLOSED; |
40 case WSAEHOSTUNREACH: | 40 case WSAEHOSTUNREACH: |
41 case WSAENETUNREACH: | 41 case WSAENETUNREACH: |
42 return ERR_ADDRESS_UNREACHABLE; | 42 return ERR_ADDRESS_UNREACHABLE; |
43 case WSAEADDRNOTAVAIL: | 43 case WSAEADDRNOTAVAIL: |
44 return ERR_ADDRESS_INVALID; | 44 return ERR_ADDRESS_INVALID; |
45 case WSAEMSGSIZE: | 45 case WSAEMSGSIZE: |
46 return ERR_MSG_TOO_BIG; | 46 return ERR_MSG_TOO_BIG; |
47 case WSAENOTCONN: | 47 case WSAENOTCONN: |
48 return ERR_SOCKET_NOT_CONNECTED; | 48 return ERR_SOCKET_NOT_CONNECTED; |
wtc
2013/05/01 01:01:00
Nit: could you add the new error code here?
Bei Zhang
2013/05/01 03:49:26
Done.
| |
49 case WSAEAFNOSUPPORT: | 49 case WSAEAFNOSUPPORT: |
50 return ERR_ADDRESS_UNREACHABLE; | 50 return ERR_ADDRESS_UNREACHABLE; |
51 case WSAEINVAL: | 51 case WSAEINVAL: |
52 return ERR_INVALID_ARGUMENT; | 52 return ERR_INVALID_ARGUMENT; |
53 case WSAEADDRINUSE: | 53 case WSAEADDRINUSE: |
54 return ERR_ADDRESS_IN_USE; | 54 return ERR_ADDRESS_IN_USE; |
55 case WSAEISCONN: | |
56 return ERR_SOCKET_IS_CONNECTED; | |
55 | 57 |
56 // System errors. | 58 // System errors. |
57 case ERROR_FILE_NOT_FOUND: // The system cannot find the file specified. | 59 case ERROR_FILE_NOT_FOUND: // The system cannot find the file specified. |
58 return ERR_FILE_NOT_FOUND; | 60 return ERR_FILE_NOT_FOUND; |
59 case ERROR_PATH_NOT_FOUND: // The system cannot find the path specified. | 61 case ERROR_PATH_NOT_FOUND: // The system cannot find the path specified. |
60 return ERR_FILE_NOT_FOUND; | 62 return ERR_FILE_NOT_FOUND; |
61 case ERROR_TOO_MANY_OPEN_FILES: // The system cannot open the file. | 63 case ERROR_TOO_MANY_OPEN_FILES: // The system cannot open the file. |
62 return ERR_INSUFFICIENT_RESOURCES; | 64 return ERR_INSUFFICIENT_RESOURCES; |
63 case ERROR_ACCESS_DENIED: // Access is denied. | 65 case ERROR_ACCESS_DENIED: // Access is denied. |
64 return ERR_ACCESS_DENIED; | 66 return ERR_ACCESS_DENIED; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 case ERROR_SUCCESS: | 114 case ERROR_SUCCESS: |
113 return OK; | 115 return OK; |
114 default: | 116 default: |
115 LOG(WARNING) << "Unknown error " << os_error | 117 LOG(WARNING) << "Unknown error " << os_error |
116 << " mapped to net::ERR_FAILED"; | 118 << " mapped to net::ERR_FAILED"; |
117 return ERR_FAILED; | 119 return ERR_FAILED; |
118 } | 120 } |
119 } | 121 } |
120 | 122 |
121 } // namespace net | 123 } // namespace net |
OLD | NEW |