GnuTLS uses writev() to write to the socket without giving MSG_NOSIGNAL.
---
 libavformat/tls.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/tls.c b/libavformat/tls.c
index d5de5ee..4a52e84 100644
--- a/libavformat/tls.c
+++ b/libavformat/tls.c
@@ -137,6 +137,13 @@ static int do_tls_poll(URLContext *h, int ret)
     return 0;
 }
 
+#if CONFIG_GNUTLS
+static ssize_t do_gnutls_push(gnutls_transport_ptr_t ptr, const void *data, 
size_t data_size)
+{
+    return send((intptr_t)ptr, data, data_size, MSG_NOSIGNAL);
+}
+#endif
+
 static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary 
**options)
 {
     TLSContext *c = h->priv_data;
@@ -222,6 +229,7 @@ static int tls_open(URLContext *h, const char *uri, int 
flags, AVDictionary **op
     gnutls_credentials_set(c->session, GNUTLS_CRD_CERTIFICATE, c->cred);
     gnutls_transport_set_ptr(c->session, (gnutls_transport_ptr_t)
                                          (intptr_t) c->fd);
+    gnutls_transport_set_push_function(c->session, do_gnutls_push);
     gnutls_priority_set_direct(c->session, "NORMAL", NULL);
     while (1) {
         ret = gnutls_handshake(c->session);
-- 
2.1.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to