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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/third_party/nss/patches/handshakeshortwrite.patch
===================================================================
--- net/third_party/nss/patches/handshakeshortwrite.patch (revision 0)
+++ net/third_party/nss/patches/handshakeshortwrite.patch (revision 0)
@@ -0,0 +1,54 @@
+Index: mozilla/security/nss/lib/ssl/sslsecur.c
+===================================================================
+RCS file: /cvsroot/mozilla/security/nss/lib/ssl/sslsecur.c,v
+retrieving revision 1.43.2.4
+diff -p -u -8 -r1.43.2.4 sslsecur.c
+--- mozilla/security/nss/lib/ssl/sslsecur.c 8 Apr 2011 05:25:21 -0000 1.43.2.4
++++ mozilla/security/nss/lib/ssl/sslsecur.c 4 Aug 2011 23:33:46 -0000
+@@ -383,16 +383,28 @@ SSL_ForceHandshake(PRFileDesc *fd)
+ SSL_GETPID(), fd));
+ return rv;
+ }
+
+ /* Don't waste my time */
+ if (!ss->opt.useSecurity)
+ return SECSuccess;
+
++ if (!ssl_SocketIsBlocking(ss)) {
++ ssl_GetXmitBufLock(ss);
++ if (ss->pendingBuf.len != 0) {
++ rv = ssl_SendSavedWriteData(ss);
++ if ((rv < 0) && (PORT_GetError() != PR_WOULD_BLOCK_ERROR)) {
++ ssl_ReleaseXmitBufLock(ss);
++ return SECFailure;
++ }
++ }
++ ssl_ReleaseXmitBufLock(ss);
++ }
++
+ ssl_Get1stHandshakeLock(ss);
+
+ if (ss->version >= SSL_LIBRARY_VERSION_3_0) {
+ int gatherResult;
+
+ ssl_GetRecvBufLock(ss);
+ gatherResult = ssl3_GatherCompleteHandshake(ss, 0);
+ ssl_ReleaseRecvBufLock(ss);
+@@ -1132,17 +1144,16 @@ ssl_SecureRecv(sslSocket *ss, unsigned c
+ if (!ssl_SocketIsBlocking(ss) && !ss->opt.fdx) {
+ ssl_GetXmitBufLock(ss);
+ if (ss->pendingBuf.len != 0) {
+ rv = ssl_SendSavedWriteData(ss);
+ if ((rv < 0) && (PORT_GetError() != PR_WOULD_BLOCK_ERROR)) {
+ ssl_ReleaseXmitBufLock(ss);
+ return SECFailure;
+ }
+- /* XXX short write? */
+ }
+ ssl_ReleaseXmitBufLock(ss);
+ }
+
+ rv = 0;
+ /* If any of these is non-zero, the initial handshake is not done. */
+ if (!ss->firstHsDone) {
+ ssl_Get1stHandshakeLock(ss);
Property changes on: net/third_party/nss/patches/handshakeshortwrite.patch
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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