summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsspitzer%mozilla.org <devnull@localhost>2007-04-12 22:31:06 +0000
committersspitzer%mozilla.org <devnull@localhost>2007-04-12 22:31:06 +0000
commita1fb73d9542d44976c051346f4b6c414413fe738 (patch)
tree0bb726ac0bc95a00e7836faed085daeba24d8212
parent55caee49e19b843a679bf0380bcd04ddd417426f (diff)
downloadnspr-hg-a1fb73d9542d44976c051346f4b6c414413fe738.tar.gz
fix for bug #376062: can't connect with the internet on Wista RC1
r=wtc, r=Masatoshi Kimura
-rw-r--r--pr/src/md/windows/w95sock.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/pr/src/md/windows/w95sock.c b/pr/src/md/windows/w95sock.c
index da8f8484..4c6b3577 100644
--- a/pr/src/md/windows/w95sock.c
+++ b/pr/src/md/windows/w95sock.c
@@ -167,7 +167,8 @@ _PR_MD_SOCKET(int af, int type, int flags)
return -1;
}
- if (socketSetCompatMode)
+ if ((af == AF_INET || af == AF_INET6) &&
+ type == SOCK_STREAM && socketSetCompatMode)
{
WSA_COMPATIBILITY_MODE mode;
char dummy[4];
@@ -179,9 +180,19 @@ _PR_MD_SOCKET(int af, int type, int flags)
(char *)&mode, sizeof(mode),
dummy, 4, &ret_dummy, 0, NULL) == SOCKET_ERROR)
{
- PR_SetError(PR_UNKNOWN_ERROR, WSAGetLastError());
- closesocket(sock);
- return -1;
+ 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 WSAEINVAL
+ ** don't close the socket
+ */
+ if (err != WSAEINVAL)
+ {
+ PR_SetError(PR_UNKNOWN_ERROR, err);
+ closesocket(sock);
+ return -1;
+ }
}
}