Merge changes from the Trunk to the Branch. NSS_PERFORMANCE_HACKS_BRANCH
authornelsonb%netscape.com
Mon, 29 Aug 2005 22:11:43 +0000
branchNSS_PERFORMANCE_HACKS_BRANCH
changeset 6067 8fb7ccd34f5f169ef07a7c16bb8a6d50812db74e
parent 6065 0c1cef7c0aed85189b8d489265545274b268484c
child 6068 26149b11e94fa78e60fecbed571fb5fe15b06878
push idunknown
push userunknown
push dateunknown
Merge changes from the Trunk to the Branch. Modified Files: config.mk sslsecur.c
security/nss/lib/ssl/config.mk
security/nss/lib/ssl/sslsecur.c
--- a/security/nss/lib/ssl/config.mk
+++ b/security/nss/lib/ssl/config.mk
@@ -47,26 +47,27 @@ IMPORT_LIBRARY = $(OBJDIR)/$(IMPORT_LIB_
 
 RES = $(OBJDIR)/ssl.res
 RESNAME = ssl.rc
 
 ifdef NS_USE_GCC
 EXTRA_SHARED_LIBS += \
 	-L$(DIST)/lib \
 	-lnss3 \
+	-L$(NSPR_LIB_DIR) \
 	-lplc4 \
 	-lplds4 \
 	-lnspr4 \
 	$(NULL)
 else # ! NS_USE_GCC
 EXTRA_SHARED_LIBS += \
 	$(DIST)/lib/nss3.lib \
-	$(DIST)/lib/$(NSPR31_LIB_PREFIX)plc4.lib \
-	$(DIST)/lib/$(NSPR31_LIB_PREFIX)plds4.lib \
-	$(DIST)/lib/$(NSPR31_LIB_PREFIX)nspr4.lib \
+	$(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plc4.lib \
+	$(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)plds4.lib \
+	$(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.lib \
 	$(NULL)
 endif # NS_USE_GCC
 
 # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
 CRYPTOLIB=$(DIST)/lib/$(LIB_PREFIX)freebl.$(LIB_SUFFIX)
 CRYPTODIR=../freebl
 ifdef MOZILLA_SECURITY_BUILD
 	CRYPTOLIB=$(DIST)/lib/$(LIB_PREFIX)crypto.$(LIB_SUFFIX)
@@ -90,18 +91,19 @@ endif
 EXTRA_LIBS += \
 	$(CRYPTOLIB) \
 	$(NULL)
 
 
 # $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
 # $(EXTRA_SHARED_LIBS) come before $(OS_LIBS), except on AIX.
 EXTRA_SHARED_LIBS += \
-	-L$(DIST)/lib/ \
+	-L$(DIST)/lib \
 	-lnss3 \
+	-L$(NSPR_LIB_DIR) \
 	-lplc4 \
 	-lplds4 \
 	-lnspr4 \
 	$(NULL)
 
 ifeq ($(OS_ARCH), BeOS)
 EXTRA_SHARED_LIBS += -lbe
 endif
--- a/security/nss/lib/ssl/sslsecur.c
+++ b/security/nss/lib/ssl/sslsecur.c
@@ -385,26 +385,28 @@ SSL_ForceHandshake(PRFileDesc *fd)
 ** Called for both recv buffers and xmit buffers.
 ** Caller must hold xmitBufLock or recvBufLock, as appropriate.
 */
 SECStatus
 sslBuffer_Grow(sslBuffer *b, unsigned int newLen)
 {
     newLen = PR_MAX(newLen, MAX_FRAGMENT_LENGTH + 2048);
     if (newLen > b->space) {
+	unsigned char *newBuf;
 	if (b->buf) {
-	    b->buf = (unsigned char *) PORT_Realloc(b->buf, newLen);
+	    newBuf = (unsigned char *) PORT_Realloc(b->buf, newLen);
 	} else {
-	    b->buf = (unsigned char *) PORT_Alloc(newLen);
+	    newBuf = (unsigned char *) PORT_Alloc(newLen);
 	}
-	if (!b->buf) {
+	if (!newBuf) {
 	    return SECFailure;
 	}
 	SSL_TRC(10, ("%d: SSL: grow buffer from %d to %d",
 		     SSL_GETPID(), b->space, newLen));
+	b->buf = newBuf;
 	b->space = newLen;
     }
     return SECSuccess;
 }
 
 /*
 ** Save away write data that is trying to be written before the security
 ** handshake has been completed. When the handshake is completed, we will