Skip to content

Commit

Permalink
wsd: net: always clear SSL errors after failed IO
Browse files Browse the repository at this point in the history
We unconditionally clears the SSL error
queue when errors had been found/handled.

Change-Id: Idceb4582106ece08f9e91200f5c66089041b77a4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
  • Loading branch information
Ashod authored and mmeeks committed Jan 10, 2025
1 parent 4190f66 commit 7f19872
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/SslSocket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <net/Socket.hpp>

#include <openssl/ssl.h>
#include <openssl/err.h>

#include <cerrno>
#include <sstream>
Expand Down Expand Up @@ -313,6 +314,8 @@ class SslStreamSocket final : public StreamSocket
const int ret = handleSslError(rc, last_errno, context);
errno = last_errno; // Restore errno.

ERR_clear_error(); // Make sure we leave no errors in the queue.

return ret;
}

Expand Down

0 comments on commit 7f19872

Please sign in to comment.