From 5f98c11330b81e7712bd98250369fc52db5aeb44 Mon Sep 17 00:00:00 2001 From: Kai Engert Date: Fri, 25 Aug 2017 19:01:51 +0200 Subject: [PATCH] Bug 1393854, NSPR_4_17_BETA1 UPGRADE_NSPR_RELEASE --HG-- extra : amend_source : d550e98a0f62acae0b6321ca58ef0c82bb845010 --- nsprpub/TAG-INFO | 2 +- nsprpub/config/prdepend.h | 1 - nsprpub/configure | 2 +- nsprpub/configure.in | 2 +- nsprpub/pr/include/prinit.h | 6 +++--- nsprpub/pr/include/private/pprio.h | 5 +++-- nsprpub/pr/src/io/prsocket.c | 20 +++++++++++++++++++- nsprpub/pr/src/md/windows/win32_errors.c | 8 ++++++++ nsprpub/pr/src/nspr.def | 6 +++--- nsprpub/pr/src/pthreads/ptio.c | 2 +- nsprpub/pr/tests/vercheck.c | 7 ++++--- 11 files changed, 44 insertions(+), 17 deletions(-) diff --git a/nsprpub/TAG-INFO b/nsprpub/TAG-INFO index ebe7269ae65d..122298d20162 100644 --- a/nsprpub/TAG-INFO +++ b/nsprpub/TAG-INFO @@ -1 +1 @@ -NSPR_4_16_RTM +NSPR_4_17_BETA1 diff --git a/nsprpub/config/prdepend.h b/nsprpub/config/prdepend.h index 6c66b37ca0fc..e49e92677e3e 100644 --- a/nsprpub/config/prdepend.h +++ b/nsprpub/config/prdepend.h @@ -10,4 +10,3 @@ */ #error "Do not include this header file." - diff --git a/nsprpub/configure b/nsprpub/configure index b8ad2b4ebf54..deccb5f9f68d 100755 --- a/nsprpub/configure +++ b/nsprpub/configure @@ -2488,7 +2488,7 @@ test -n "$target_alias" && program_prefix=${target_alias}- MOD_MAJOR_VERSION=4 -MOD_MINOR_VERSION=16 +MOD_MINOR_VERSION=17 MOD_PATCH_VERSION=0 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= diff --git a/nsprpub/configure.in b/nsprpub/configure.in index 22b4e72245d1..1b9604d38105 100644 --- a/nsprpub/configure.in +++ b/nsprpub/configure.in @@ -15,7 +15,7 @@ dnl ======================================================== dnl = Defaults dnl ======================================================== MOD_MAJOR_VERSION=4 -MOD_MINOR_VERSION=16 +MOD_MINOR_VERSION=17 MOD_PATCH_VERSION=0 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= diff --git a/nsprpub/pr/include/prinit.h b/nsprpub/pr/include/prinit.h index fd935ec309d4..3a90e8e1e42e 100644 --- a/nsprpub/pr/include/prinit.h +++ b/nsprpub/pr/include/prinit.h @@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C ** The format of the version string is ** ".[.] []" */ -#define PR_VERSION "4.16" +#define PR_VERSION "4.17 Beta" #define PR_VMAJOR 4 -#define PR_VMINOR 16 +#define PR_VMINOR 17 #define PR_VPATCH 0 -#define PR_BETA PR_FALSE +#define PR_BETA PR_TRUE /* ** PRVersionCheck diff --git a/nsprpub/pr/include/private/pprio.h b/nsprpub/pr/include/private/pprio.h index 90c25a04c903..83d3715b1b69 100644 --- a/nsprpub/pr/include/private/pprio.h +++ b/nsprpub/pr/include/private/pprio.h @@ -237,8 +237,9 @@ NSPR_API(PRStatus) PR_NT_CancelIo(PRFileDesc *fd); #endif /* WIN32 */ -/* FUNCTION: PR_FileDesc2PlatformOverlappedIOHandle +/* FUNCTION: PR_EXPERIMENTAL_ONLY_IN_4_17_GetOverlappedIOHandle ** DESCRIPTION: +** This function will be available only in nspr version 4.17 ** This functionality is only available on windows. Some windows operation use ** asynchronous (call overlapped) io. One of them is ConnectEx. NSPR uses ** ConnectEx for enabling TCP Fast Open. @@ -248,7 +249,7 @@ NSPR_API(PRStatus) PR_NT_CancelIo(PRFileDesc *fd); ** PRFileDesc continues to be owner of the structure and the structure must not ** be destroyed. */ -NSPR_API(PRStatus) PR_FileDesc2PlatformOverlappedIOHandle(PRFileDesc *fd, void **ol); +NSPR_API(PRStatus) PR_EXPERIMENTAL_ONLY_IN_4_17_GetOverlappedIOHandle(PRFileDesc *fd, void **ol); PR_END_EXTERN_C diff --git a/nsprpub/pr/src/io/prsocket.c b/nsprpub/pr/src/io/prsocket.c index b2535828e2a9..b42f05683e39 100644 --- a/nsprpub/pr/src/io/prsocket.c +++ b/nsprpub/pr/src/io/prsocket.c @@ -304,7 +304,25 @@ static PRStatus PR_CALLBACK SocketConnectContinue( if (err != 0) { _PR_MD_MAP_CONNECT_ERROR(err); } else { +#if defined(_WIN64) + if (fd->secret->overlappedActive) { + PRInt32 rvSent; + if (GetOverlappedResult(osfd, &fd->secret->ol, &rvSent, FALSE) == FALSE) { + err = WSAGetLastError(); + PR_LOG(_pr_io_lm, PR_LOG_MIN, + ("SocketConnectContinue GetOverlappedResult failed %d\n", err)); + if (err != ERROR_IO_INCOMPLETE) { + _PR_MD_MAP_CONNECT_ERROR(err); + fd->secret->overlappedActive = PR_FALSE; + } + } + } + if (err == 0) { + PR_SetError(PR_UNKNOWN_ERROR, 0); + } +#else PR_SetError(PR_UNKNOWN_ERROR, 0); +#endif } return PR_FAILURE; } @@ -1668,7 +1686,7 @@ PR_ChangeFileDescNativeHandle(PRFileDesc *fd, PROsfd handle) /* Expose OVERLAPPED if present. OVERLAPPED is implemented only on WIN95. */ PR_IMPLEMENT(PRStatus) -PR_FileDesc2PlatformOverlappedIOHandle(PRFileDesc *fd, void **ol) +PR_EXPERIMENTAL_ONLY_IN_4_17_GetOverlappedIOHandle(PRFileDesc *fd, void **ol) { #if defined(_WIN64) && defined(WIN95) *ol = NULL; diff --git a/nsprpub/pr/src/md/windows/win32_errors.c b/nsprpub/pr/src/md/windows/win32_errors.c index d26820a7a9a8..275792187560 100644 --- a/nsprpub/pr/src/md/windows/win32_errors.c +++ b/nsprpub/pr/src/md/windows/win32_errors.c @@ -166,21 +166,26 @@ void _MD_win32_map_default_error(PRInt32 err) prError = PR_ADDRESS_IN_USE_ERROR; break; case WSAEADDRNOTAVAIL: + case ERROR_INVALID_NETNAME: prError = PR_ADDRESS_NOT_AVAILABLE_ERROR; break; case WSAEAFNOSUPPORT: + case ERROR_INCORRECT_ADDRESS: prError = PR_ADDRESS_NOT_SUPPORTED_ERROR; break; case WSAEALREADY: + case ERROR_ALREADY_INITIALIZED: prError = PR_ALREADY_INITIATED_ERROR; break; case WSAEBADF: prError = PR_BAD_DESCRIPTOR_ERROR; break; case WSAECONNABORTED: + case ERROR_CONNECTION_ABORTED: prError = PR_CONNECT_ABORTED_ERROR; break; case WSAECONNREFUSED: + case ERROR_CONNECTION_REFUSED: prError = PR_CONNECT_REFUSED_ERROR; break; case WSAECONNRESET: @@ -193,6 +198,7 @@ void _MD_win32_map_default_error(PRInt32 err) prError = PR_ACCESS_FAULT_ERROR; break; case WSAEHOSTUNREACH: + case ERROR_HOST_UNREACHABLE: prError = PR_HOST_UNREACHABLE_ERROR; break; case WSAEINVAL: @@ -208,12 +214,14 @@ void _MD_win32_map_default_error(PRInt32 err) prError = PR_BUFFER_OVERFLOW_ERROR; break; case WSAENETDOWN: + case ERROR_NO_NETWORK: prError = PR_NETWORK_DOWN_ERROR; break; case WSAENETRESET: prError = PR_CONNECT_ABORTED_ERROR; break; case WSAENETUNREACH: + case ERROR_NETWORK_UNREACHABLE: prError = PR_NETWORK_UNREACHABLE_ERROR; break; case WSAENOBUFS: diff --git a/nsprpub/pr/src/nspr.def b/nsprpub/pr/src/nspr.def index c1430531fa66..927769005164 100644 --- a/nsprpub/pr/src/nspr.def +++ b/nsprpub/pr/src/nspr.def @@ -462,7 +462,7 @@ EXPORTS ;- PR_DuplicateEnvironment; PR_GetEnvSecure; ;+} NSPR_4.10.3; -;+NSPR_4.16 { +;+NSPR_4.17 { ;+ global: - PR_FileDesc2PlatformOverlappedIOHandle; -;+} NSPR_4.15; + PR_EXPERIMENTAL_ONLY_IN_4_17_GetOverlappedIOHandle; +;+} NSPR_4.16; diff --git a/nsprpub/pr/src/pthreads/ptio.c b/nsprpub/pr/src/pthreads/ptio.c index 4f0c36a37646..ebe6d8d88ace 100644 --- a/nsprpub/pr/src/pthreads/ptio.c +++ b/nsprpub/pr/src/pthreads/ptio.c @@ -4746,7 +4746,7 @@ PR_IMPLEMENT(PRInt32) PR_FileDesc2NativeHandle(PRFileDesc *bottom) /* Expose OVERLAPPED if present. OVERLAPPED is implemented only on WIN95. */ PR_IMPLEMENT(PRStatus) -PR_FileDesc2PlatformOverlappedIOHandle(PRFileDesc *fd, void **ol) +PR_EXPERIMENTAL_ONLY_IN_4_17_GetOverlappedIOHandle(PRFileDesc *fd, void **ol) { PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); return PR_FAILURE; diff --git a/nsprpub/pr/tests/vercheck.c b/nsprpub/pr/tests/vercheck.c index 6170125dea5a..7a13363dbec2 100644 --- a/nsprpub/pr/tests/vercheck.c +++ b/nsprpub/pr/tests/vercheck.c @@ -39,7 +39,8 @@ static char *compatible_version[] = { "4.9.6", "4.10", "4.10.1", "4.10.2", "4.10.3", "4.10.4", "4.10.5", "4.10.6", "4.10.7", "4.10.8", "4.10.9", - "4.10.10", "4.11", "4.12", "4.13", "4.14", "4.15" + "4.10.10", "4.11", "4.12", "4.13", "4.14", "4.15", + "4.16", PR_VERSION }; @@ -55,8 +56,8 @@ static char *incompatible_version[] = { "3.0", "3.0.1", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.5", "3.5.1", - "4.16.1", - "4.17", "4.17.1", + "4.17.1", + "4.18", "4.18.1", "10.0", "11.1", "12.14.20" };