Update NSPR to NSPR_4_8_9_BETA1, which includes the fixes for
authorWan-Teh Chang <wtc@google.com>
Wed, 11 May 2011 18:36:38 -0700
changeset 69370 6e1f4652252d361dca4b3780e1ae6dbccff1bd30
parent 69369 0b9b70e20848d326d01699cb27ce3857aacad2c1
child 69371 46f139db20181e78e74a83783ccef249c0786230
push idunknown
push userunknown
push dateunknown
bugs513659, 650474
milestone6.0a1
Update NSPR to NSPR_4_8_9_BETA1, which includes the fixes for bug 513659 and bug 650474.
nsprpub/TAG-INFO
nsprpub/admin/repackage.sh
nsprpub/config/prdepend.h
nsprpub/configure
nsprpub/configure.in
nsprpub/pr/include/prinit.h
nsprpub/pr/src/md/windows/w95sock.c
nsprpub/pr/src/misc/prnetdb.c
nsprpub/pr/tests/vercheck.c
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_8_8_RTM
+NSPR_4_8_9_BETA1
--- a/nsprpub/admin/repackage.sh
+++ b/nsprpub/admin/repackage.sh
@@ -59,20 +59,20 @@
 # Note! Files written with Gnu tar are not readable by some non-Gnu
 # versions. Sun, in particular.
 # 
 # 
 # 
 # 
 # ------------------------------------------------------------------
 
-FROMTOP=/share/builds/components/nspr20/v4.8.8
-TOTOP=./v4.8.8
-NSPRDIR=nspr-4.8.8
-SOURCETAG=NSPR_4_8_8_RTM
+FROMTOP=/share/builds/components/nspr20/v4.8.9
+TOTOP=./v4.8.9
+NSPRDIR=nspr-4.8.9
+SOURCETAG=NSPR_4_8_9_RTM
 
 #
 # enumerate Unix object directories on /s/b/c
 UNIX_OBJDIRS="
 HP-UXB.11.11_64_DBG.OBJ
 HP-UXB.11.11_64_OPT.OBJ
 HP-UXB.11.11_DBG.OBJ
 HP-UXB.11.11_OPT.OBJ
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -37,8 +37,9 @@
 
 /*
  * 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
@@ -708,17 +708,17 @@ echo "$ac_t""$build" 1>&6
 test "$host_alias" != "$target_alias" &&
   test "$program_prefix$program_suffix$program_transform_name" = \
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
 
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=8
-MOD_PATCH_VERSION=8
+MOD_PATCH_VERSION=9
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
 USE_CPLUS=
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -45,17 +45,17 @@ AC_INIT(config/libc_r.h)
 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
 AC_CANONICAL_SYSTEM
 
 dnl ========================================================
 dnl = Defaults
 dnl ========================================================
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=8
-MOD_PATCH_VERSION=8
+MOD_PATCH_VERSION=9
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
 USE_CPLUS=
--- a/nsprpub/pr/include/prinit.h
+++ b/nsprpub/pr/include/prinit.h
@@ -58,21 +58,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.8.8"
+#define PR_VERSION  "4.8.9 Beta"
 #define PR_VMAJOR   4
 #define PR_VMINOR   8
-#define PR_VPATCH   8
-#define PR_BETA     PR_FALSE
+#define PR_VPATCH   9
+#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/src/md/windows/w95sock.c
+++ b/nsprpub/pr/src/md/windows/w95sock.c
@@ -102,16 +102,17 @@ typedef int (__stdcall * WSAIOCTLPROC) (
 typedef struct _WSA_COMPATIBILITY_MODE {
     WSA_COMPATIBILITY_BEHAVIOR_ID BehaviorId;
     ULONG TargetOsVersion;
 } WSA_COMPATIBILITY_MODE, *PWSA_COMPATIBILITY_MODE;
 
 static HMODULE libWinsock2 = NULL;
 static WSAIOCTLPROC wsaioctlProc = NULL;
 static PRBool socketSetCompatMode = PR_FALSE;
+static PRBool socketFixInet6RcvBuf = PR_FALSE;
 
 void _PR_MD_InitSockets(void)
 {
     OSVERSIONINFO osvi;
 
     memset(&osvi, 0, sizeof(osvi));
     osvi.dwOSVersionInfoSize = sizeof(osvi);
     GetVersionEx(&osvi);
@@ -125,16 +126,21 @@ void _PR_MD_InitSockets(void)
             wsaioctlProc = (WSAIOCTLPROC)GetProcAddress(libWinsock2, 
                                                         "WSAIoctl");
             if (wsaioctlProc)
             {
                 socketSetCompatMode = PR_TRUE;
             }
         }
     }
+    else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
+    {
+        /* if Windows XP (32-bit) */
+        socketFixInet6RcvBuf = PR_TRUE;
+    }
 }
 
 void _PR_MD_CleanupSockets(void)
 {
     socketSetCompatMode = PR_FALSE;
     wsaioctlProc = NULL;
     if (libWinsock2)
     {
@@ -185,16 +191,37 @@ PROsfd
 
             /* SIO_SET_COMPATIBILITY_MODE may not be supported.
             ** If the call to WSAIoctl() fails with WSAEOPNOTSUPP,
             ** don't close the socket.
             */ 
         }
     }
 
+    if (af == AF_INET6 && socketFixInet6RcvBuf)
+    {
+        int bufsize;
+        int len = sizeof(bufsize);
+        int rv;
+
+        /* Windows XP 32-bit returns an error on getpeername() for AF_INET6
+         * sockets if the receive buffer size is greater than 65535 before
+         * the connection is initiated. The default receive buffer size may
+         * be 128000 so fix it here to always be <= 65535. See bug 513659
+         * and IBM DB2 support technote "Receive/Send IPv6 Socket Size
+         * Problem in Windows XP SP2 & SP3".
+         */
+        rv = getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*)&bufsize, &len);
+        if (rv == 0 && bufsize > 65535)
+        {
+            bufsize = 65535;
+            setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*)&bufsize, len);
+        }
+    }
+
     return (PROsfd)sock;
 }
 
 /*
 ** _MD_CloseSocket() -- Close a socket
 **
 */
 PRInt32
--- a/nsprpub/pr/src/misc/prnetdb.c
+++ b/nsprpub/pr/src/misc/prnetdb.c
@@ -2072,16 +2072,22 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInf
          * will get back repetitive entries: one for each socket type.  since
          * we do not expose ai_socktype through our API, it is okay to do this
          * here.  the application may still choose to create a socket of some
          * other type.
          */
         hints.ai_socktype = SOCK_STREAM;
 
         rv = GETADDRINFO(hostname, NULL, &hints, &res);
+#ifdef AI_ADDRCONFIG
+        if (rv == EAI_BADFLAGS) {
+            hints.ai_flags &= ~AI_ADDRCONFIG;
+            rv = GETADDRINFO(hostname, NULL, &hints, &res);
+        }
+#endif
         if (rv == 0)
             return (PRAddrInfo *) res;
 
         PR_SetError(PR_DIRECTORY_LOOKUP_ERROR, rv);
     }
     return NULL;
 #endif
 }
--- a/nsprpub/pr/tests/vercheck.c
+++ b/nsprpub/pr/tests/vercheck.c
@@ -47,46 +47,46 @@
  */
 
 #include "prinit.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 
 /*
- * This release (4.8.8) is backward compatible with the
+ * This release (4.8.9) is backward compatible with the
  * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x,
- * 4.8, 4.8.1, 4.8.2, 4.8.3, 4.8.4, 4.8.5, 4.8.6 and 4.8.7 releases.
- * It, of course, is compatible with itself.
+ * 4.8, 4.8.1, 4.8.2, 4.8.3, 4.8.4, 4.8.5, 4.8.6, 4.8.7, and
+ * 4.8.8 releases.  It, of course, is compatible with itself.
  */
 static char *compatible_version[] = {
     "4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3",
     "4.2", "4.2.1", "4.2.2", "4.3", "4.4", "4.4.1",
     "4.5", "4.5.1",
     "4.6", "4.6.1", "4.6.2", "4.6.3", "4.6.4", "4.6.5",
     "4.6.6", "4.6.7", "4.6.8",
     "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", PR_VERSION
+    "4.8.6", "4.8.7", "4.8.8", 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.8.9",
+    "4.8.10",
     "4.9", "4.9.1",
     "10.0", "11.1", "12.14.20"
 };
 
 int main(int argc, char **argv)
 {
     int idx;
     int num_compatible = sizeof(compatible_version) / sizeof(char *);