[exim-cvs] OpenSSSL: support write-with-more-intent in clien…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Exim Git Commits Mailing List
Dátum:  
Címzett: exim-cvs
Tárgy: [exim-cvs] OpenSSSL: support write-with-more-intent in client
Gitweb: https://git.exim.org/exim.git/commitdiff/ac35befe29020ebd38c62a7dd48f7977a0856048
Commit:     ac35befe29020ebd38c62a7dd48f7977a0856048
Parent:     d7978c0f8af20ff4c3f770589b1bb81568aecff3
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sat Dec 29 18:41:48 2018 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Feb 10 23:22:50 2019 +0000


    OpenSSSL: support write-with-more-intent in client


    (cherry picked from commit f6a1bb920eebdba0d4a6c295c4d054307b49b2b1)
---
 src/src/tls-openssl.c | 10 ++++++----
 test/confs/4060       |  2 ++
 2 files changed, 8 insertions(+), 4 deletions(-)


diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c
index 5cb1ac1..f04cbf8 100644
--- a/src/src/tls-openssl.c
+++ b/src/src/tls-openssl.c
@@ -2900,6 +2900,7 @@ Used by both server-side and client-side TLS.
int
tls_write(void * ct_ctx, const uschar *buff, size_t len, BOOL more)
{
+size_t olen = len;
int outbytes, error;
SSL * ssl = ct_ctx ? ((exim_openssl_client_tls_ctx *)ct_ctx)->ssl : server_ssl;
static gstring * corked = NULL;
@@ -2911,10 +2912,11 @@ DEBUG(D_tls) debug_printf("%s(%p, %lu%s)\n", __FUNCTION__,
"more" is notified. This hack is only ok if small amounts are involved AND only
one stream does it, in one context (i.e. no store reset). Currently it is used
for the responses to the received SMTP MAIL , RCPT, DATA sequence, only. */
-/*XXX + if PIPE_COMMAND, banner & ehlo-resp for smmtp-on-connect. Suspect there's
-a store reset there. */
+/* + if PIPE_COMMAND, banner & ehlo-resp for smmtp-on-connect. Suspect there's
+a store reset there, so use POOL_PERM. */
+/* + if CHUNKING, cmds EHLO,MAIL,RCPT(s),BDAT */

-if (!ct_ctx && (more || corked))
+if ((more || corked))
   {
 #ifdef EXPERIMENTAL_PIPE_CONNECT
   int save_pool = store_pool;
@@ -2967,7 +2969,7 @@ for (int left = len; left > 0;)
       return -1;
     }
   }
-return len;
+return olen;
 }



diff --git a/test/confs/4060 b/test/confs/4060
index dcc0ec2..30d65a1 100644
--- a/test/confs/4060
+++ b/test/confs/4060
@@ -26,6 +26,8 @@ tls_certificate = ${if eq {SERVER}{server}{DIR/aux-fixed/cert1}fail}
# Avoid ECDHE key-exchange so that we can wireshark-decode (not TLS1.3)
.ifdef _HAVE_GNUTLS
tls_require_ciphers = NORMAL:-KX-ALL:+RSA
+.else
+tls_require_ciphers = DEFAULT:!kECDHE
.endif

pipelining_connect_advertise_hosts = *