Skip to content

Commit

Permalink
restore errno when release success in pooled socket (alibaba#499)
Browse files Browse the repository at this point in the history
Signed-off-by: liulanzheng <lanzheng.liulz@alibaba-inc.com>
  • Loading branch information
liulanzheng committed Jun 4, 2024
1 parent d11243d commit 40a8ea1
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 40a8ea1

Please sign in to comment.