Bug 1393854, NSPR_4_17_BETA1
authorKai Engert <kaie@kuix.de>
Fri, 25 Aug 2017 19:01:51 +0200
changeset 376913 58518d8f651a3b9da8d0a241b226124f862fbd2f
parent 376912 3d38ebe3179eff291055e3f49f49479e9ff75504
child 376914 914bf1d6ad15803a8484d523945059045f915735
push id32394
push userkwierso@gmail.com
push dateFri, 25 Aug 2017 23:22:16 +0000
treeherdermozilla-central@86a3c73984a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1393854
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1393854, NSPR_4_17_BETA1 UPGRADE_NSPR_RELEASE
nsprpub/TAG-INFO
nsprpub/config/prdepend.h
nsprpub/configure
nsprpub/configure.in
nsprpub/pr/include/prinit.h
nsprpub/pr/include/private/pprio.h
nsprpub/pr/src/io/prsocket.c
nsprpub/pr/src/md/windows/win32_errors.c
nsprpub/pr/src/nspr.def
nsprpub/pr/src/pthreads/ptio.c
nsprpub/pr/tests/vercheck.c
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_16_RTM
+NSPR_4_17_BETA1
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -5,9 +5,8 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
-
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -2483,17 +2483,17 @@ case $target_os in *\ *) target_os=`echo
 # The aliases save the names the user supplied, while $host etc.
 # will get canonicalized.
 test -n "$target_alias" &&
   test "$program_prefix$program_suffix$program_transform_name" = \
     NONENONEs,x,x, &&
   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=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_X32=
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -10,17 +10,17 @@ AC_CONFIG_SRCDIR([pr/include/nspr.h])
 
 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
 AC_CANONICAL_TARGET
 
 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=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_X32=
--- a/nsprpub/pr/include/prinit.h
+++ b/nsprpub/pr/include/prinit.h
@@ -26,21 +26,21 @@ PR_BEGIN_EXTERN_C
 /*
 ** NSPR's version is used to determine the likelihood that the version you
 ** used to build your component is anywhere close to being compatible with
 ** what is in the underlying library.
 **
 ** The format of the version string is
 **     "<major version>.<minor version>[.<patch level>] [<Beta>]"
 */
-#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
 **
 ** The basic signature of the function that is called to provide version
 ** checking. The result will be a boolean that indicates the likelihood
 ** that the underling library will perform as the caller expects.
 **
--- a/nsprpub/pr/include/private/pprio.h
+++ b/nsprpub/pr/include/private/pprio.h
@@ -232,24 +232,25 @@ NSPR_API(void) PR_NTFast_UpdateAcceptCon
 ** DESCRIPTION:
 **    Cancel IO operations on fd.
 */
 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.
 ** This function returns an OVERLAPPED structure associated with ConnectEx call.
 ** If ConnectEx has not been called or the io has already finished, the
 ** function will return PR_INVALID_ARGUMENT_ERROR.
 ** 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
 
 #endif /* pprio_h___ */
--- a/nsprpub/pr/src/io/prsocket.c
+++ b/nsprpub/pr/src/io/prsocket.c
@@ -299,17 +299,35 @@ static PRStatus PR_CALLBACK SocketConnec
         if (getsockopt(osfd, (int)SOL_SOCKET, SO_ERROR, (char *) &err, &len)
                 == SOCKET_ERROR) {
             _PR_MD_MAP_GETSOCKOPT_ERROR(WSAGetLastError());
             return PR_FAILURE;
         }
         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;
     }
 
     PR_ASSERT(out_flags & PR_POLL_WRITE);
 
 #if defined(_WIN64)
     if (fd->secret->alreadyConnected) {
@@ -1663,17 +1681,17 @@ PR_IMPLEMENT(void)
 PR_ChangeFileDescNativeHandle(PRFileDesc *fd, PROsfd handle)
 {
 	if (fd)
 		fd->secret->md.osfd = 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;
     if (fd) {
         fd = PR_GetIdentitiesLayer(fd, PR_NSPR_IO_LAYER);
     }
     if (!fd) {
         PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
--- a/nsprpub/pr/src/md/windows/win32_errors.c
+++ b/nsprpub/pr/src/md/windows/win32_errors.c
@@ -161,64 +161,72 @@ void _MD_win32_map_default_error(PRInt32
             break;
         case WSAEACCES:
             prError = PR_NO_ACCESS_RIGHTS_ERROR;
             break;
         case WSAEADDRINUSE:
             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:
             prError = PR_CONNECT_RESET_ERROR;
             break;
         case WSAEDESTADDRREQ:
             prError = PR_INVALID_ARGUMENT_ERROR;
             break;
         case WSAEFAULT:
             prError = PR_ACCESS_FAULT_ERROR;
             break;
         case WSAEHOSTUNREACH:
+        case ERROR_HOST_UNREACHABLE:
             prError = PR_HOST_UNREACHABLE_ERROR;
             break;
         case WSAEINVAL:
             prError = PR_INVALID_ARGUMENT_ERROR;
             break;
         case WSAEISCONN:
             prError = PR_IS_CONNECTED_ERROR;
             break;
         case WSAEMFILE:
             prError = PR_PROC_DESC_TABLE_FULL_ERROR;
             break;
         case WSAEMSGSIZE:
             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:
             prError = PR_INSUFFICIENT_RESOURCES_ERROR;
             break;
         case WSAENOPROTOOPT:
             prError = PR_INVALID_ARGUMENT_ERROR;
             break;
--- a/nsprpub/pr/src/nspr.def
+++ b/nsprpub/pr/src/nspr.def
@@ -457,12 +457,12 @@ EXPORTS ;-
 ;+} NSPR_4.9.2;
 ;+# Function PR_DuplicateEnvironment had been added in NSPR 4.10.9,
 ;+# but we neglected to add it to nspr.def until NSPR 4.12
 ;+NSPR_4.12 {
 ;+      global:
 		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;
--- a/nsprpub/pr/src/pthreads/ptio.c
+++ b/nsprpub/pr/src/pthreads/ptio.c
@@ -4741,17 +4741,17 @@ PR_IMPLEMENT(PRInt32) PR_FileDesc2Native
         NULL : PR_GetIdentitiesLayer(bottom, PR_NSPR_IO_LAYER);
     if (NULL == bottom) PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
     else osfd = bottom->secret->md.osfd;
     return osfd;
 }  /* PR_FileDesc2NativeHandle */
 
 /* 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;
 }
 
 PR_IMPLEMENT(void) PR_ChangeFileDescNativeHandle(PRFileDesc *fd,
     PRInt32 handle)
 {
--- a/nsprpub/pr/tests/vercheck.c
+++ b/nsprpub/pr/tests/vercheck.c
@@ -34,34 +34,35 @@ static char *compatible_version[] = {
     "4.7", "4.7.1", "4.7.2", "4.7.3", "4.7.4", "4.7.5",
     "4.7.6",
     "4.8", "4.8.1", "4.8.2", "4.8.3", "4.8.4", "4.8.5",
     "4.8.6", "4.8.7", "4.8.8", "4.8.9",
     "4.9", "4.9.1", "4.9.2", "4.9.3", "4.9.4", "4.9.5",
     "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
 };
 
 /*
  * This release is not backward compatible with the old
  * NSPR 2.1 and 3.x releases.
  *
  * Any release is incompatible with future releases and
  * patches.
  */
 static char *incompatible_version[] = {
     "2.1 19980529",
     "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"
 };
 
 int main(int argc, char **argv)
 {
     int idx;
     int num_compatible = sizeof(compatible_version) / sizeof(char *);
     int num_incompatible = sizeof(incompatible_version) / sizeof(char *);