OLD | NEW |
(Empty) | |
| 1 Index: mozilla/security/nss/lib/ssl/sslsecur.c |
| 2 =================================================================== |
| 3 RCS file: /cvsroot/mozilla/security/nss/lib/ssl/sslsecur.c,v |
| 4 retrieving revision 1.43.2.4 |
| 5 diff -p -u -8 -r1.43.2.4 sslsecur.c |
| 6 --- mozilla/security/nss/lib/ssl/sslsecur.c 8 Apr 2011 05:25:21 -0000
1.43.2.4 |
| 7 +++ mozilla/security/nss/lib/ssl/sslsecur.c 4 Aug 2011 23:33:46 -0000 |
| 8 @@ -383,16 +383,28 @@ SSL_ForceHandshake(PRFileDesc *fd) |
| 9 SSL_GETPID(), fd)); |
| 10 return rv; |
| 11 } |
| 12 |
| 13 /* Don't waste my time */ |
| 14 if (!ss->opt.useSecurity) |
| 15 return SECSuccess; |
| 16 |
| 17 + if (!ssl_SocketIsBlocking(ss)) { |
| 18 + ssl_GetXmitBufLock(ss); |
| 19 + if (ss->pendingBuf.len != 0) { |
| 20 + rv = ssl_SendSavedWriteData(ss); |
| 21 + if ((rv < 0) && (PORT_GetError() != PR_WOULD_BLOCK_ERROR)) { |
| 22 + ssl_ReleaseXmitBufLock(ss); |
| 23 + return SECFailure; |
| 24 + } |
| 25 + } |
| 26 + ssl_ReleaseXmitBufLock(ss); |
| 27 + } |
| 28 + |
| 29 ssl_Get1stHandshakeLock(ss); |
| 30 |
| 31 if (ss->version >= SSL_LIBRARY_VERSION_3_0) { |
| 32 int gatherResult; |
| 33 |
| 34 ssl_GetRecvBufLock(ss); |
| 35 gatherResult = ssl3_GatherCompleteHandshake(ss, 0); |
| 36 ssl_ReleaseRecvBufLock(ss); |
| 37 @@ -1132,17 +1144,16 @@ ssl_SecureRecv(sslSocket *ss, unsigned c |
| 38 if (!ssl_SocketIsBlocking(ss) && !ss->opt.fdx) { |
| 39 ssl_GetXmitBufLock(ss); |
| 40 if (ss->pendingBuf.len != 0) { |
| 41 rv = ssl_SendSavedWriteData(ss); |
| 42 if ((rv < 0) && (PORT_GetError() != PR_WOULD_BLOCK_ERROR)) { |
| 43 ssl_ReleaseXmitBufLock(ss); |
| 44 return SECFailure; |
| 45 } |
| 46 - /* XXX short write? */ |
| 47 } |
| 48 ssl_ReleaseXmitBufLock(ss); |
| 49 } |
| 50 |
| 51 rv = 0; |
| 52 /* If any of these is non-zero, the initial handshake is not done. */ |
| 53 if (!ss->firstHsDone) { |
| 54 ssl_Get1stHandshakeLock(ss); |
OLD | NEW |