summaryrefslogtreecommitdiff
path: root/ext/dtls/gstdtlsconnection.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2020-10-05 16:40:55 -0400
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-10-10 15:34:21 +0000
commit8a0d1d85cf4787aa0923815c2a35015ff00c463e (patch)
treebe5e621f70636f9fd8b2d8c9c2a4ccf5c42bd5dd /ext/dtls/gstdtlsconnection.c
parent3ea6387f969c0b08027fc959b8b8cd102708bceb (diff)
downloadgstreamer-plugins-bad-8a0d1d85cf4787aa0923815c2a35015ff00c463e.tar.gz
dtlsconnection: Ignore OpenSSL system call errors
OpenSSL shouldn't be making real system calls, so we can safely ignore syscall errors. System interactions should happen through our BIO. So especially don't look at the system's errno, as it should be meaningless. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1656>
Diffstat (limited to 'ext/dtls/gstdtlsconnection.c')
-rw-r--r--ext/dtls/gstdtlsconnection.c36
1 files changed, 7 insertions, 29 deletions
diff --git a/ext/dtls/gstdtlsconnection.c b/ext/dtls/gstdtlsconnection.c
index 0e802351e..22e013230 100644
--- a/ext/dtls/gstdtlsconnection.c
+++ b/ext/dtls/gstdtlsconnection.c
@@ -1001,35 +1001,13 @@ handle_error (GstDtlsConnection * self, int ret, GstResourceError error_type,
case SSL_ERROR_WANT_WRITE:
GST_LOG_OBJECT (self, "SSL wants write");
return GST_FLOW_OK;
- case SSL_ERROR_SYSCALL:{
- gchar message[1024] = "<unknown>";
- gint syserror;
-#ifdef G_OS_WIN32
- syserror = WSAGetLastError ();
- FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, syserror, 0, message,
- sizeof message, NULL);
-#else
- syserror = errno;
- strerror_r (syserror, message, sizeof message);
-#endif
-
- if (syserror == 0) {
- GST_TRACE_OBJECT (self, "No error");
- return GST_FLOW_OK;
- } else {
- GST_ERROR_OBJECT (self, "Fatal SSL syscall error: errno %d: %s",
- syserror, message);
- if (err)
- *err =
- g_error_new (GST_RESOURCE_ERROR, error_type,
- "Fatal SSL syscall error: errno %d: %s", syserror, message);
- if (self->priv->connection_state != GST_DTLS_CONNECTION_STATE_FAILED) {
- self->priv->connection_state = GST_DTLS_CONNECTION_STATE_FAILED;
- *notify_state = TRUE;
- }
- return GST_FLOW_ERROR;
- }
- }
+ case SSL_ERROR_SYSCALL:
+ /* OpenSSL shouldn't be making real system calls, so we can safely
+ * ignore syscall errors. System interactions should happen through
+ * our BIO.
+ */
+ GST_DEBUG_OBJECT (self, "OpenSSL reported a syscall error, ignoring.");
+ return GST_FLOW_OK;
default:
if (self->priv->connection_state != GST_DTLS_CONNECTION_STATE_FAILED) {
self->priv->connection_state = GST_DTLS_CONNECTION_STATE_FAILED;