Skip to content

Commit

Permalink
Bug 888273: Update NSPR to NSPR_4_10_1_BETA1 to pick up the bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
wantehchang committed Jul 25, 2013
1 parent 617e34f commit eaaa861
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 217 deletions.
2 changes: 1 addition & 1 deletion nsprpub/TAG-INFO
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NSPR_4_10_RTM
NSPR_4_10_1_BETA1
1 change: 1 addition & 0 deletions nsprpub/config/prdepend.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
*/

#error "Do not include this header file."

220 changes: 110 additions & 110 deletions nsprpub/configure

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion nsprpub/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dnl = Defaults
dnl ========================================================
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=10
MOD_PATCH_VERSION=0
MOD_PATCH_VERSION=1
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
Expand Down
6 changes: 3 additions & 3 deletions nsprpub/pr/include/prinit.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/
#define PR_VERSION "4.10"
#define PR_VERSION "4.10.1 Beta"
#define PR_VMAJOR 4
#define PR_VMINOR 10
#define PR_VPATCH 0
#define PR_BETA PR_FALSE
#define PR_VPATCH 1
#define PR_BETA PR_TRUE

/*
** PRVersionCheck
Expand Down
101 changes: 2 additions & 99 deletions nsprpub/pr/src/md/windows/w95sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,60 +21,6 @@ static PRInt32 socket_io_wait(

/* --- SOCKET IO --------------------------------------------------------- */

/*
* we only want to call WSAIoctl() on Vista and later
* so don't pay for it at build time (and avoid including winsock2.h)
*/

/* from ws2def.h */
#define IOC_IN 0x80000000 /* copy in parameters */
#define IOC_VENDOR 0x18000000
#define _WSAIOW(x,y) (IOC_IN|(x)|(y))
/* from MSWSockDef.h */
#define SIO_SET_COMPATIBILITY_MODE _WSAIOW(IOC_VENDOR,300)

typedef enum _WSA_COMPATIBILITY_BEHAVIOR_ID {
WsaBehaviorAll = 0,
WsaBehaviorReceiveBuffering,
WsaBehaviorAutoTuning
} WSA_COMPATIBILITY_BEHAVIOR_ID, *PWSA_COMPATIBILITY_BEHAVIOR_ID;

/* from sdkddkver.h */
#define NTDDI_WIN6 0x06000000 /* Windows Vista */

/* from winsock2.h */
#define WSAEVENT HANDLE

#define WSAOVERLAPPED OVERLAPPED
typedef struct _OVERLAPPED * LPWSAOVERLAPPED;

typedef void (CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(
IN DWORD dwError,
IN DWORD cbTransferred,
IN LPWSAOVERLAPPED lpOverlapped,
IN DWORD dwFlags
);

typedef int (__stdcall * WSAIOCTLPROC) (
SOCKET s,
DWORD dwIoControlCode,
LPVOID lpvInBuffer,
DWORD cbInBuffer,
LPVOID lpvOutBuffer,
DWORD cbOutBuffer,
LPDWORD lpcbBytesReturned,
LPWSAOVERLAPPED lpOverlapped,
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);

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)
Expand All @@ -85,21 +31,7 @@ void _PR_MD_InitSockets(void)
osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionEx(&osvi);

/* if Vista or later... */
if (osvi.dwMajorVersion >= 6)
{
libWinsock2 = LoadLibraryW(L"Ws2_32.dll");
if (libWinsock2)
{
wsaioctlProc = (WSAIOCTLPROC)GetProcAddress(libWinsock2,
"WSAIoctl");
if (wsaioctlProc)
{
socketSetCompatMode = PR_TRUE;
}
}
}
else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
{
/* if Windows XP (32-bit) */
socketFixInet6RcvBuf = PR_TRUE;
Expand All @@ -108,13 +40,7 @@ void _PR_MD_InitSockets(void)

void _PR_MD_CleanupSockets(void)
{
socketSetCompatMode = PR_FALSE;
wsaioctlProc = NULL;
if (libWinsock2)
{
FreeLibrary(libWinsock2);
libWinsock2 = NULL;
}
socketFixInet6RcvBuf = PR_FALSE;
}

PROsfd
Expand All @@ -141,29 +67,6 @@ _PR_MD_SOCKET(int af, int type, int flags)
return -1;
}

if ((af == AF_INET || af == AF_INET6) &&
type == SOCK_STREAM && socketSetCompatMode)
{
WSA_COMPATIBILITY_MODE mode;
char dummy[4];
int ret_dummy;

mode.BehaviorId = WsaBehaviorAutoTuning;
mode.TargetOsVersion = NTDDI_WIN6;
if (wsaioctlProc(sock, SIO_SET_COMPATIBILITY_MODE,
(char *)&mode, sizeof(mode),
dummy, 4, &ret_dummy, 0, NULL) == SOCKET_ERROR)
{
int err = WSAGetLastError();
PR_LOG(_pr_io_lm, PR_LOG_DEBUG, ("WSAIoctl() failed with %d", err));

/* 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;
Expand Down
7 changes: 4 additions & 3 deletions nsprpub/pr/tests/vercheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#include <stdlib.h>

/*
* This release (4.10) is backward compatible with the
* This release (4.10.1) 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.x, and 4.9.x releases.
* 4.8.x, 4.9.x, and 4.10 releases.
* It, of course, is compatible with itself.
*/
static char *compatible_version[] = {
Expand All @@ -37,6 +37,7 @@ static char *compatible_version[] = {
"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",
PR_VERSION
};

Expand All @@ -52,7 +53,7 @@ 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.10.1",
"4.10.2",
"4.11", "4.11.1",
"10.0", "11.1", "12.14.20"
};
Expand Down

0 comments on commit eaaa861

Please sign in to comment.