Skip to content

Commit

Permalink
SocketTls: use named constant
Browse files Browse the repository at this point in the history
  • Loading branch information
mporsch committed Aug 5, 2023
1 parent a16f587 commit 85c1a7a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/socket_tls_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace {
// the number is arbitrary and used only to avoid/detect infinite loops
constexpr int handshakeStepsMax = 10;

constexpr auto zeroTimeout = Duration(0);

namespace bio {

int Write(BIO *b, char const *data, int s)
Expand Down Expand Up @@ -235,7 +237,7 @@ size_t SocketTlsImpl::Receive(char *data, size_t size)
lastError = SSL_ERROR_NONE;
}

return Read(data, size, Duration(0));
return Read(data, size, zeroTimeout);
}

size_t SocketTlsImpl::Send(char const *data, size_t size,
Expand All @@ -252,7 +254,7 @@ size_t SocketTlsImpl::SendSome(char const *data, size_t size)
lastError = SSL_ERROR_NONE;
}

return Write(data, size, Duration(0));
return Write(data, size, zeroTimeout);
}

void SocketTlsImpl::Connect(SockAddrView const &connectAddr)
Expand Down

0 comments on commit 85c1a7a

Please sign in to comment.