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,6 +114,7 @@ bufferevent_socket_set_conn_address_fd(struct bufferevent_private *bev_p, int fd
|
|||||||
socklen_t len = sizeof(bev_p->conn_address);
|
socklen_t len = sizeof(bev_p->conn_address);
|
||||||
|
|
||||||
struct sockaddr *addr = (struct sockaddr *)&bev_p->conn_address;
|
struct sockaddr *addr = (struct sockaddr *)&bev_p->conn_address;
|
||||||
|
if (addr->sa_family != AF_UNSPEC)
|
||||||
getpeername(fd, addr, &len);
|
getpeername(fd, addr, &len);
|
||||||
}
|
}
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user