diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-11-13 17:47:40 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-11-13 17:47:40 +0000 |
commit | a1e24ac8399b0f5b86599a5258ea5b2d8d002820 (patch) | |
tree | cbe2b35daf79b56f0b055230daf3323cd48ffe0f /src/conns.c | |
parent | cf138d74797a01b9d7e85171e60257944fc43128 (diff) |
(destroy_conn): Added code to log any error messages when the sockets
are closed.
Diffstat (limited to 'src/conns.c')
-rw-r--r-- | src/conns.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/conns.c b/src/conns.c index c353599..013b681 100644 --- a/src/conns.c +++ b/src/conns.c @@ -1,4 +1,4 @@ -/* $Id: conns.c,v 1.12 2002-05-24 04:45:32 rjkaes Exp $ +/* $Id: conns.c,v 1.13 2002-11-13 17:47:40 rjkaes Exp $ * * Create and free the connection structure. One day there could be * other connection related tasks put here, but for now the header @@ -23,6 +23,7 @@ #include "buffer.h" #include "conns.h" #include "heap.h" +#include "log.h" #include "stats.h" struct conn_s * @@ -93,9 +94,13 @@ destroy_conn(struct conn_s *connptr) assert(connptr != NULL); if (connptr->client_fd != -1) - close(connptr->client_fd); + if (close(connptr->client_fd) < 0) + log_message(LOG_INFO, "Client (%d) close message: %s", + connptr->client_fd, strerror(errno)); if (connptr->server_fd != -1) - close(connptr->server_fd); + if (close(connptr->server_fd) < 0) + log_message(LOG_INFO, "Server (%d) close message: %s", + connptr->server_fd, strerror(errno)); if (connptr->cbuffer) delete_buffer(connptr->cbuffer); |