mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-15 00:34:05 +09:00
log accept error codes in httpd.c
This commit is contained in:
@@ -201,7 +201,7 @@ httpd_remove_connection(httpd_t *httpd, http_connection_t *connection, int sock_
|
|||||||
int socket_fd = connection->socket_fd;
|
int socket_fd = connection->socket_fd;
|
||||||
connection->socket_fd = 0;
|
connection->socket_fd = 0;
|
||||||
if (sock_err) {
|
if (sock_err) {
|
||||||
logger_log(httpd->logger, LOGGER_INFO, "httpd: recv error %d on socket %d: %s",
|
logger_log(httpd->logger, LOGGER_ERR, "httpd: recv error %d on socket %d: %s",
|
||||||
sock_err, socket_fd, SOCKET_ERROR_STRING(sock_err));
|
sock_err, socket_fd, SOCKET_ERROR_STRING(sock_err));
|
||||||
}
|
}
|
||||||
if (connection->request) {
|
if (connection->request) {
|
||||||
@@ -280,6 +280,9 @@ httpd_accept_connection(httpd_t *httpd, int server_fd, int is_ipv6)
|
|||||||
fd = accept(server_fd, (struct sockaddr *)&remote_saddr, &remote_saddrlen);
|
fd = accept(server_fd, (struct sockaddr *)&remote_saddr, &remote_saddrlen);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
/* FIXME: Error happened */
|
/* FIXME: Error happened */
|
||||||
|
int sock_err = SOCKET_GET_ERROR();
|
||||||
|
logger_log(httpd->logger, LOGGER_ERR, "httpd: error in accept: %d %s",
|
||||||
|
sock_err, SOCKET_ERROR_STRING(sock_err));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user