Skip to content

Commit

Permalink
restore errno when release success in pooled socket
Browse files Browse the repository at this point in the history
Signed-off-by: liulanzheng <[email protected]>
  • Loading branch information
liulanzheng committed Jun 3, 2024
1 parent 13a3401 commit 16d9a47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/pooled_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,11 @@ class TCPSocketPool : public ForwardSocketClient {

bool release(const EndPoint& ep, ISocketStream* stream) {
auto fd = stream->get_underlay_fd();
ERRNO err;
if (!stream_alive(fd)) return false;
auto node = new StreamListNode(ep, stream, fd, TTL_us);
push_into_pool(node);
errno = err.no;
return true;
}

Expand Down

0 comments on commit 16d9a47

Please sign in to comment.