Skip to content

Commit

Permalink
Fixed unexpected server disconnection due to SSL_ERROR_SYSCALL with e…
Browse files Browse the repository at this point in the history
…rrno == EAGAIN

Seems like the documentation recommends just repeating the request
  • Loading branch information
botanegg committed Feb 14, 2023
1 parent ea53abd commit 3f8b439
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Socket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ class Socket {
return Code::Memory;
case ETIMEDOUT:
return Code::Timeout;
case ECONNABORTED:
return Code::Cancel;
# if EAGAIN != EWOULDBLOCK
case EAGAIN:
# endif
case ECONNABORTED:
return Code::Cancel;
case EWOULDBLOCK:
case EINTR:
return Code::Retry;
Expand Down
3 changes: 3 additions & 0 deletions src/TLS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ ::Code SocketTLS::interpretLibCode(const int code, const bool processed, const b
case SSL_ERROR_WANT_WRITE:
return WaitOut;
case SSL_ERROR_SYSCALL:
if (ERR_get_error() == 0 && osErrorToCode(osError()) == mumble::Code::Retry) {
return Retry;
}
m_closed = true;

if (!processed) {
Expand Down

0 comments on commit 3f8b439

Please sign in to comment.