close socket when sp_add failed

This commit is contained in:
Cloud Wu
2015-12-17 10:04:38 +08:00
parent 8ff5bcb372
commit 4f8427a23f

View File

@@ -832,7 +832,7 @@ start_socket(struct socket_server *ss, struct request_start *request, struct soc
}
if (s->type == SOCKET_TYPE_PACCEPT || s->type == SOCKET_TYPE_PLISTEN) {
if (sp_add(ss->event_fd, s->fd, s)) {
s->type = SOCKET_TYPE_INVALID;
force_close(ss, s, result);
result->data = strerror(errno);
return SOCKET_ERROR;
}