| OLD | NEW |
| (Empty) |
| 1 From eb24998651cb972c60453b5d5fb1e13dfd8107ce Mon Sep 17 00:00:00 2001 | |
| 2 From: Adam Langley <agl@chromium.org> | |
| 3 Date: Mon, 3 Oct 2011 12:26:44 -0400 | |
| 4 Subject: [PATCH] handshakeshortwrite.patch | |
| 5 | |
| 6 --- | |
| 7 mozilla/security/nss/lib/ssl/sslsecur.c | 13 ++++++++++++- | |
| 8 1 files changed, 12 insertions(+), 1 deletions(-) | |
| 9 | |
| 10 diff --git a/mozilla/security/nss/lib/ssl/sslsecur.c b/mozilla/security/nss/lib/
ssl/sslsecur.c | |
| 11 index 816b8f6..dc374e0 100644 | |
| 12 --- a/mozilla/security/nss/lib/ssl/sslsecur.c | |
| 13 +++ b/mozilla/security/nss/lib/ssl/sslsecur.c | |
| 14 @@ -388,6 +388,18 @@ SSL_ForceHandshake(PRFileDesc *fd) | |
| 15 if (!ss->opt.useSecurity) | |
| 16 return SECSuccess; | |
| 17 | |
| 18 + if (!ssl_SocketIsBlocking(ss)) { | |
| 19 + ssl_GetXmitBufLock(ss); | |
| 20 + if (ss->pendingBuf.len != 0) { | |
| 21 + int sent = ssl_SendSavedWriteData(ss); | |
| 22 + if ((sent < 0) && (PORT_GetError() != PR_WOULD_BLOCK_ERROR)) { | |
| 23 + ssl_ReleaseXmitBufLock(ss); | |
| 24 + return SECFailure; | |
| 25 + } | |
| 26 + } | |
| 27 + ssl_ReleaseXmitBufLock(ss); | |
| 28 + } | |
| 29 + | |
| 30 ssl_Get1stHandshakeLock(ss); | |
| 31 | |
| 32 if (ss->version >= SSL_LIBRARY_VERSION_3_0) { | |
| 33 @@ -1128,7 +1140,6 @@ ssl_SecureRecv(sslSocket *ss, unsigned char *buf, int len,
int flags) | |
| 34 ssl_ReleaseXmitBufLock(ss); | |
| 35 return SECFailure; | |
| 36 } | |
| 37 - /* XXX short write? */ | |
| 38 } | |
| 39 ssl_ReleaseXmitBufLock(ss); | |
| 40 } | |
| OLD | NEW |