summaryrefslogtreecommitdiff
path: root/libavformat/tls_schannel.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/tls_schannel.c')
-rw-r--r--libavformat/tls_schannel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/tls_schannel.c b/libavformat/tls_schannel.c
index 7a8842e7fe..fec43ffafd 100644
--- a/libavformat/tls_schannel.c
+++ b/libavformat/tls_schannel.c
@@ -392,7 +392,12 @@ static int tls_read(URLContext *h, uint8_t *buf, int len)
int size, ret;
int min_enc_buf_size = len + SCHANNEL_FREE_BUFFER_SIZE;
- if (len <= c->dec_buf_offset)
+ /* If we have some left-over data from previous network activity,
+ * return it first in case it is enough. It may contain
+ * data that is required to know whether this connection
+ * is still required or not, esp. in case of HTTP keep-alive
+ * connections. */
+ if (c->dec_buf_offset > 0)
goto cleanup;
if (c->sspi_close_notify)