tune error messages to show select or poll depending on what is used
This commit is contained in:
parent
22e4898519
commit
da1bc1425d
@ -99,7 +99,7 @@ void child_main_loop (void)
|
||||
|
||||
/*
|
||||
* We have to wait for connections on multiple fds,
|
||||
* so use select.
|
||||
* so use select/poll/whatever.
|
||||
*/
|
||||
while (!config->quit) {
|
||||
|
||||
@ -136,11 +136,11 @@ void child_main_loop (void)
|
||||
if (errno == EINTR) {
|
||||
continue;
|
||||
}
|
||||
log_message (LOG_ERR, "error calling select: %s",
|
||||
log_message (LOG_ERR, "error calling " SELECT_OR_POLL ": %s",
|
||||
strerror(errno));
|
||||
continue;
|
||||
} else if (ret == 0) {
|
||||
log_message (LOG_WARNING, "Strange: select returned 0 "
|
||||
log_message (LOG_WARNING, "Strange: " SELECT_OR_POLL " returned 0 "
|
||||
"but we did not specify a timeout...");
|
||||
continue;
|
||||
}
|
||||
@ -158,7 +158,7 @@ void child_main_loop (void)
|
||||
|
||||
if (listenfd == -1) {
|
||||
log_message(LOG_WARNING, "Strange: None of our listen "
|
||||
"fds was readable after select");
|
||||
"fds was readable after " SELECT_OR_POLL);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_POLL_H
|
||||
#define SELECT_OR_POLL "poll"
|
||||
|
||||
#include <poll.h>
|
||||
typedef struct pollfd pollfd_struct;
|
||||
@ -13,6 +14,7 @@ typedef struct pollfd pollfd_struct;
|
||||
|
||||
#else
|
||||
|
||||
#define SELECT_OR_POLL "select"
|
||||
#include <sys/select.h>
|
||||
typedef struct mypollfd {
|
||||
int fd;
|
||||
|
@ -1163,11 +1163,11 @@ static void relay_connection (struct conn_s *connptr)
|
||||
|
||||
if (ret == 0) {
|
||||
log_message (LOG_INFO,
|
||||
"Idle Timeout (after select)");
|
||||
"Idle Timeout (after " SELECT_OR_POLL ")");
|
||||
return;
|
||||
} else if (ret < 0) {
|
||||
log_message (LOG_ERR,
|
||||
"relay_connection: select() error \"%s\". "
|
||||
"relay_connection: " SELECT_OR_POLL "() error \"%s\". "
|
||||
"Closing connection (client_fd:%d, server_fd:%d)",
|
||||
strerror (errno), connptr->client_fd,
|
||||
connptr->server_fd);
|
||||
@ -1440,7 +1440,7 @@ get_request_entity(struct conn_s *connptr)
|
||||
|
||||
if (ret == -1) {
|
||||
log_message (LOG_ERR,
|
||||
"Error calling select on client fd %d: %s",
|
||||
"Error calling " SELECT_OR_POLL " on client fd %d: %s",
|
||||
connptr->client_fd, strerror(errno));
|
||||
} else if (ret == 0) {
|
||||
log_message (LOG_INFO, "no entity");
|
||||
@ -1459,7 +1459,7 @@ get_request_entity(struct conn_s *connptr)
|
||||
ret = 0;
|
||||
}
|
||||
} else {
|
||||
log_message (LOG_ERR, "strange situation after select: "
|
||||
log_message (LOG_ERR, "strange situation after " SELECT_OR_POLL ": "
|
||||
"ret = %d, but client_fd (%d) is not readable...",
|
||||
ret, connptr->client_fd);
|
||||
ret = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user