uv-unix: call uv__accept() instead of accept()
uv__accept() puts the socket in non-blocking close-on-exec mode, accept() by itself does not. Solves the case of the mysteriously hanging HTTP benchmarks.
This commit is contained in:
parent
332bbecd19
commit
66f936bfd7
@ -405,7 +405,6 @@ static int uv__stream_open(uv_stream_t* stream, int fd) {
|
|||||||
void uv__server_io(EV_P_ ev_io* watcher, int revents) {
|
void uv__server_io(EV_P_ ev_io* watcher, int revents) {
|
||||||
int fd;
|
int fd;
|
||||||
struct sockaddr_storage addr;
|
struct sockaddr_storage addr;
|
||||||
socklen_t addrlen = sizeof(struct sockaddr_storage);
|
|
||||||
uv_stream_t* stream = watcher->data;
|
uv_stream_t* stream = watcher->data;
|
||||||
|
|
||||||
assert(watcher == &stream->read_watcher ||
|
assert(watcher == &stream->read_watcher ||
|
||||||
@ -421,7 +420,7 @@ void uv__server_io(EV_P_ ev_io* watcher, int revents) {
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
assert(stream->accepted_fd < 0);
|
assert(stream->accepted_fd < 0);
|
||||||
fd = accept(stream->fd, (struct sockaddr*)&addr, &addrlen);
|
fd = uv__accept(stream->fd, (struct sockaddr*)&addr, sizeof addr);
|
||||||
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
if (errno == EAGAIN) {
|
if (errno == EAGAIN) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user