Commit d1bdc0b2 authored by Robert Ricci's avatar Robert Ricci

Added some debugging information to the log about which file

descriptor each connection is using - this will aid debugging if
we discover that I'm somehow leaking file descriptors. An old
version of the code seemed to, but I believe it's fixed now.
parent f2a57d0b
......@@ -132,6 +132,8 @@ int main(int argc, char **argv) {
}
}
printf("\n");
fprinttimestamp(stdout);
printf(" Maximum number of clients: %i \n", FD_SETSIZE);
/*
......@@ -316,7 +318,7 @@ int main(int argc, char **argv) {
fprinttimestamp(stdout);
printf(" Too many clients, dropping ");
fprintaddr(stdout,&clientaddr);
printf("\n");
printf(" [%i]\n", newclient);
close(newclient);
} else if (newclient == -1) {
if (errno == EINTR || errno == EWOULDBLOCK ||
......@@ -338,7 +340,7 @@ int main(int argc, char **argv) {
fprinttimestamp(stdout);
printf(" New client: ");
fprintaddr(stdout,&clientaddr);
printf("\n");
printf(" [%i]\n",newclient);
/*
* Try to set the socket buffer size
......@@ -391,7 +393,7 @@ int main(int argc, char **argv) {
fprinttimestamp(stdout);
printf(" Client disconnected: ");
fprintaddr(stdout,clients + i);
printf("\n");
printf(" [%i]\n",i);
close_connection = true;
} else if (readbytes == -1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment