476 |
|
|
477 |
if(rv > 0) { |
if(rv > 0) { |
478 |
|
|
|
pthread_mutex_lock(&Run.mutex_fd); |
|
|
|
|
479 |
if( (client= accept(server, (struct sockaddr*)&in, &len)) < 0) { |
if( (client= accept(server, (struct sockaddr*)&in, &len)) < 0) { |
480 |
|
|
|
pthread_mutex_unlock(&Run.mutex_fd); |
|
|
|
|
481 |
if(stopped) { |
if(stopped) { |
482 |
log("http server: service stopped\n"); |
log("http server: service stopped\n"); |
483 |
} else { |
} else { |
488 |
|
|
489 |
} |
} |
490 |
|
|
|
if(fcntl(client, F_SETFD, fcntl(client, F_GETFD) | FD_CLOEXEC) == -1) { |
|
|
close(client); |
|
|
pthread_mutex_unlock(&Run.mutex_fd); |
|
|
return NULL; |
|
|
} |
|
|
|
|
|
pthread_mutex_unlock(&Run.mutex_fd); |
|
|
|
|
491 |
} else { |
} else { |
492 |
|
|
493 |
/* in the case that timeout or error occured, return NULL to allow |
/* in the case that timeout or error occured, return NULL to allow |