Bugzilla bug 127062: use PR_MSG_PEEK instead of MSG_PEEK.

This commit is contained in:
wtc%netscape.com 2002-05-01 00:21:50 +00:00
Родитель 2d7fe2e0eb
Коммит e4f5bd3810
1 изменённых файлов: 3 добавлений и 13 удалений

Просмотреть файл

@ -32,7 +32,7 @@
* may use your version of this file under either the MPL or the * may use your version of this file under either the MPL or the
* GPL. * GPL.
* *
* $Id: sslsecur.c,v 1.17 2002/03/23 01:06:08 nelsonb%netscape.com Exp $ * $Id: sslsecur.c,v 1.18 2002/05/01 00:21:50 wtc%netscape.com Exp $
*/ */
#include "cert.h" #include "cert.h"
#include "secitem.h" #include "secitem.h"
@ -43,16 +43,6 @@
#include "secoid.h" /* for SECOID_GetALgorithmTag */ #include "secoid.h" /* for SECOID_GetALgorithmTag */
#include "pk11func.h" /* for PK11_GenerateRandom */ #include "pk11func.h" /* for PK11_GenerateRandom */
#if defined(_WINDOWS)
#include "winsock.h" /* for MSG_PEEK */
#elif defined(XP_MAC)
#include "macsocket.h"
#elif defined(BEOS)
#define MSG_PEEK 0x2
#else
#include <sys/socket.h> /* for MSG_PEEK */
#endif
#define MAX_BLOCK_CYPHER_SIZE 32 #define MAX_BLOCK_CYPHER_SIZE 32
#define TEST_FOR_FAILURE /* reminder */ #define TEST_FOR_FAILURE /* reminder */
@ -549,7 +539,7 @@ DoRecv(sslSocket *ss, unsigned char *out, int len, int flags)
/* Dole out clear data to reader */ /* Dole out clear data to reader */
amount = PR_MIN(len, available); amount = PR_MIN(len, available);
PORT_Memcpy(out, ss->gs.buf.buf + ss->gs.readOffset, amount); PORT_Memcpy(out, ss->gs.buf.buf + ss->gs.readOffset, amount);
if (!(flags & MSG_PEEK)) { if (!(flags & PR_MSG_PEEK)) {
ss->gs.readOffset += amount; ss->gs.readOffset += amount;
} }
rv = amount; rv = amount;
@ -952,7 +942,7 @@ ssl_SecureRecv(sslSocket *ss, unsigned char *buf, int len, int flags)
PORT_SetError(PR_SOCKET_SHUTDOWN_ERROR); PORT_SetError(PR_SOCKET_SHUTDOWN_ERROR);
return PR_FAILURE; return PR_FAILURE;
} }
if (flags & ~MSG_PEEK) { if (flags & ~PR_MSG_PEEK) {
PORT_SetError(PR_INVALID_ARGUMENT_ERROR); PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
return PR_FAILURE; return PR_FAILURE;
} }