Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: net/third_party/nss/patches/handshakeshortwrite.patch

Issue 7572043: SSL_ForceHandshake should send the saved write data in the SSL socket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/third_party/nss/patches/applypatches.sh ('k') | net/third_party/nss/ssl/sslsecur.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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);
OLDNEW
« no previous file with comments | « net/third_party/nss/patches/applypatches.sh ('k') | net/third_party/nss/ssl/sslsecur.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698