OLD | NEW |
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* This Source Code Form is subject to the terms of the Mozilla Public | 2 /* This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 #include "primpl.h" | 6 #include "primpl.h" |
7 | 7 |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 /************************************************************************/ | 10 /************************************************************************/ |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 281 |
282 err = _MD_unix_get_nonblocking_connect_error(osfd); | 282 err = _MD_unix_get_nonblocking_connect_error(osfd); |
283 if (err != 0) { | 283 if (err != 0) { |
284 _PR_MD_MAP_CONNECT_ERROR(err); | 284 _PR_MD_MAP_CONNECT_ERROR(err); |
285 return PR_FAILURE; | 285 return PR_FAILURE; |
286 } | 286 } |
287 return PR_SUCCESS; | 287 return PR_SUCCESS; |
288 | 288 |
289 #elif defined(WIN32) || defined(WIN16) | 289 #elif defined(WIN32) || defined(WIN16) |
290 | 290 |
291 #if defined(WIN32) | |
292 /* | |
293 * The sleep circumvents a bug in Win32 WinSock. | |
294 * See Microsoft Knowledge Base article ID: Q165989. | |
295 */ | |
296 Sleep(0); | |
297 #endif /* WIN32 */ | |
298 | |
299 if (out_flags & PR_POLL_EXCEPT) { | 291 if (out_flags & PR_POLL_EXCEPT) { |
300 int len = sizeof(err); | 292 int len = sizeof(err); |
301 if (getsockopt(osfd, (int)SOL_SOCKET, SO_ERROR, (char *) &err, &len) | 293 if (getsockopt(osfd, (int)SOL_SOCKET, SO_ERROR, (char *) &err, &len) |
302 == SOCKET_ERROR) { | 294 == SOCKET_ERROR) { |
303 _PR_MD_MAP_GETSOCKOPT_ERROR(WSAGetLastError()); | 295 _PR_MD_MAP_GETSOCKOPT_ERROR(WSAGetLastError()); |
304 return PR_FAILURE; | 296 return PR_FAILURE; |
305 } | 297 } |
306 if (err != 0) { | 298 if (err != 0) { |
307 _PR_MD_MAP_CONNECT_ERROR(err); | 299 _PR_MD_MAP_CONNECT_ERROR(err); |
308 } else { | 300 } else { |
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1793 PR_DELETE(poll); | 1785 PR_DELETE(poll); |
1794 | 1786 |
1795 return npds; | 1787 return npds; |
1796 out_of_memory: | 1788 out_of_memory: |
1797 PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); | 1789 PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0); |
1798 return -1; | 1790 return -1; |
1799 | 1791 |
1800 #endif /* !defined(NEED_SELECT) */ | 1792 #endif /* !defined(NEED_SELECT) */ |
1801 | 1793 |
1802 } | 1794 } |
OLD | NEW |