mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Merge branch 'master' of ssh://github.com/libevent/libevent
This commit is contained in:
commit
108896abcc
@ -140,12 +140,15 @@ launch_request(void)
|
|||||||
sin.sin_port = htons(8080);
|
sin.sin_port = htons(8080);
|
||||||
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
|
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (evutil_make_socket_nonblocking(sock) < 0)
|
if (evutil_make_socket_nonblocking(sock) < 0) {
|
||||||
|
evutil_closesocket(sock);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
frob_socket(sock);
|
frob_socket(sock);
|
||||||
if (connect(sock, (struct sockaddr*)&sin, sizeof(sin)) < 0) {
|
if (connect(sock, (struct sockaddr*)&sin, sizeof(sin)) < 0) {
|
||||||
int e = errno;
|
int e = errno;
|
||||||
if (! EVUTIL_ERR_CONNECT_RETRIABLE(e)) {
|
if (! EVUTIL_ERR_CONNECT_RETRIABLE(e)) {
|
||||||
|
evutil_closesocket(sock);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user