gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 44/125: openssl: improve data-pending check for htt


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 44/125: openssl: improve data-pending check for https proxy
Date: Sun, 21 Jan 2018 23:41:39 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 9dfb19483366d5cb2d020328330b164603f71bc8
Author: Jay Satiro <address@hidden>
AuthorDate: Sun Sep 24 01:42:37 2017 -0400

    openssl: improve data-pending check for https proxy
    
    - Allow proxy_ssl to be checked for pending data even when connssl does
      not yet have an SSL handle.
    
    This change is for posterity. Currently there doesn't seem to be a code
    path that will cause a pending data check when proxyssl could have
    pending data and the connssl handle doesn't yet exist [1].
    
    [1]: Recall that an https proxy connection starts out in connssl but if
    the destination is also https then the proxy SSL backend data is moved
    from connssl to proxyssl, which means connssl handle is temporarily
    empty until an SSL handle for the destination can be created.
    
    Ref: https://github.com/curl/curl/commit/f4a6238#commitcomment-24396542
    
    Closes https://github.com/curl/curl/pull/1916
---
 lib/vtls/openssl.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index d0f525523..4659c7997 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -3383,12 +3383,13 @@ static bool Curl_ossl_data_pending(const struct 
connectdata *conn,
 {
   const struct ssl_connect_data *connssl = &conn->ssl[connindex];
   const struct ssl_connect_data *proxyssl = &conn->proxy_ssl[connindex];
-  if(BACKEND->handle)
-    /* SSL is in use */
-    return (0 != SSL_pending(BACKEND->handle) ||
-           (proxyssl->backend->handle &&
-            0 != SSL_pending(proxyssl->backend->handle))) ?
-           TRUE : FALSE;
+
+  if(connssl->backend->handle && SSL_pending(connssl->backend->handle))
+    return TRUE;
+
+  if(proxyssl->backend->handle && SSL_pending(proxyssl->backend->handle))
+    return TRUE;
+
   return FALSE;
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]