diff --git a/library/ssl_tls.c b/library/ssl_tls.c index f81a5e2d0..bae8433fe 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -4832,8 +4832,11 @@ int ssl_read( ssl_context *ssl, unsigned char *buf, size_t len ) ssl->in_msglen -= n; if( ssl->in_msglen == 0 ) + { /* all bytes consumed */ ssl->in_offt = NULL; + ssl->keep_current_message = 0; + } else /* more data available */ ssl->in_offt += n;