mirror of
https://github.com/cuberite/libevent.git
synced 2025-08-04 01:36:23 -04:00
be: we don't need to use getpeername() we we have conn_address
Since getpeername() could fail.
This commit is contained in:
parent
e5615aa7a3
commit
2c271e24f5
@ -114,7 +114,8 @@ bufferevent_socket_set_conn_address_fd(struct bufferevent_private *bev_p, int fd
|
||||
socklen_t len = sizeof(bev_p->conn_address);
|
||||
|
||||
struct sockaddr *addr = (struct sockaddr *)&bev_p->conn_address;
|
||||
getpeername(fd, addr, &len);
|
||||
if (addr->sa_family != AF_UNSPEC)
|
||||
getpeername(fd, addr, &len);
|
||||
}
|
||||
static void
|
||||
bufferevent_socket_set_conn_address(struct bufferevent_private *bev_p,
|
||||
|
Loading…
x
Reference in New Issue
Block a user