summaryrefslogtreecommitdiff
path: root/ext/dtls
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2020-03-27 10:34:25 +1100
committerMatthew Waters <matthew@centricular.com>2020-03-27 11:43:53 +1100
commit8da177c0bfb9e223aaa8e5e698a568e5f42a0e82 (patch)
tree64f73011eefb05cff3f0af6b5235239b52da6b47 /ext/dtls
parent319a5e5779e1bae7e26fa157fd24f57fc9b9f1e6 (diff)
downloadgstreamer-plugins-bad-8da177c0bfb9e223aaa8e5e698a568e5f42a0e82.tar.gz
dtls/connection: fix EOF handling with openssl 1.1.1e
openssl 1.1.1e does some stricker EOF handling and will throw an error if the EOF is unexpected (like in the middle of a record). As we are streaming data into openssl here, it is entirely possible that we push data from multiple buffers/packets into openssl separately. From the openssl changelog: Changes between 1.1.1d and 1.1.1e [17 Mar 2020] *) Properly detect EOF while reading in libssl. Previously if we hit an EOF while reading in libssl then we would report an error back to the application (SSL_ERROR_SYSCALL) but errno would be 0. We now add an error to the stack (which means we instead return SSL_ERROR_SSL) and therefore give a hint as to what went wrong. [Matt Caswell] We can relax the EOF signalling to only return TRUE when we have stopped for any reason (EOS, error). Will also remove a spurious EOF error from previous openssl version.
Diffstat (limited to 'ext/dtls')
-rw-r--r--ext/dtls/gstdtlsconnection.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/dtls/gstdtlsconnection.c b/ext/dtls/gstdtlsconnection.c
index e28703084..b9ea1efc7 100644
--- a/ext/dtls/gstdtlsconnection.c
+++ b/ext/dtls/gstdtlsconnection.c
@@ -1251,7 +1251,7 @@ bio_method_ctrl (BIO * bio, int cmd, long arg1, void *arg2)
GST_LOG_OBJECT (self, "BIO: EOF reset");
return 1;
case BIO_CTRL_EOF:{
- gint eof = !(priv->bio_buffer_len - priv->bio_buffer_offset);
+ gint eof = priv->is_alive == FALSE;
GST_LOG_OBJECT (self, "BIO: EOF query returned %d", eof);
return eof;
}