mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
WPS: Merge common error paths in HTTP server
There is no need to maintain three separate "goto fail" cases. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
96ace55e6c
commit
f79a19746a
@ -277,11 +277,9 @@ struct http_server * http_server_init(struct in_addr *addr, int port,
|
||||
"%s", srv->port, strerror(errno));
|
||||
goto fail;
|
||||
}
|
||||
if (listen(srv->fd, 10 /* max backlog */) < 0)
|
||||
goto fail;
|
||||
if (fcntl(srv->fd, F_SETFL, O_NONBLOCK) < 0)
|
||||
goto fail;
|
||||
if (eloop_register_sock(srv->fd, EVENT_TYPE_READ, http_server_cb,
|
||||
if (listen(srv->fd, 10 /* max backlog */) < 0 ||
|
||||
fcntl(srv->fd, F_SETFL, O_NONBLOCK) < 0 ||
|
||||
eloop_register_sock(srv->fd, EVENT_TYPE_READ, http_server_cb,
|
||||
srv, NULL))
|
||||
goto fail;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user