From d15952d784f5692e01fdb7696f6b863cc2273329 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 14 Feb 2003 11:44:08 +0000 Subject: [PATCH] Fix bad log entries from relaying. svn path=/trunk/icecast/; revision=4346 --- src/client.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/client.c b/src/client.c index 4dedbc80..ea350218 100644 --- a/src/client.c +++ b/src/client.c @@ -19,7 +19,7 @@ client_t *client_create(connection_t *con, http_parser_t *parser) { - client_t *client = (client_t *)malloc(sizeof(client_t)); + client_t *client = (client_t *)calloc(1, sizeof(client_t)); client->con = con; client->parser = parser; @@ -33,8 +33,11 @@ void client_destroy(client_t *client) { refbuf_t *refbuf; - /* write log entry */ - logging_access(client); + /* write log entry if ip is set (some things don't set it, like outgoing + * slave requests + */ + if(client->con->ip) + logging_access(client); connection_close(client->con); httpp_destroy(client->parser);