Correct the amount returned by ssl_Writev for short writes on non-blocking NSS_3_11_BRANCH
authornelson%bolyard.com
Wed, 17 May 2006 23:00:55 +0000
branchNSS_3_11_BRANCH
changeset 7082 fbfb615d5d4cbfc9d711818d637e29319bb1c3ae
parent 7081 513f5911f55841a786e062be031f5718246ce775
child 7086 5845f63537bde89bb5f680e6174f47fb71eecb9c
push idunknown
push userunknown
push dateunknown
bugs338325
Correct the amount returned by ssl_Writev for short writes on non-blocking sockets. Bug 338325. patch by Chris Newman <chris.newman@sun.com> r=nelson
security/nss/lib/ssl/sslsock.c
--- a/security/nss/lib/ssl/sslsock.c
+++ b/security/nss/lib/ssl/sslsock.c
@@ -1672,17 +1672,17 @@ ssl_WriteV(PRFileDesc *fd, const PRIOVec
 		&& (sent > 0)) { \
 		return sent; \
 	    } else { \
 		return -1; \
 	    } \
 	} \
 	/* Only a nonblocking socket can have partial sends */ \
 	PR_ASSERT(!blocking); \
-	return sent; \
+	return sent + rv; \
     } 
 #define SEND(bfr, len) \
     do { \
 	rv = ssl_Send(fd, bfr, len, 0, timeout); \
 	HANDLE_ERR(rv, len) \
 	sent += len; \
     } while (0)