From 498ff5c74d72d11d152ba5feb8e10f52f590b08d Mon Sep 17 00:00:00 2001 From: Karl Heyes Date: Wed, 26 Jan 2005 20:52:28 +0000 Subject: [PATCH] fix hard to trigger race, resync doc to trunk svn path=/icecast/branches/kh/icecast/; revision=8794 --- doc/icecast2_yp.html | 6 +++--- src/connection.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/icecast2_yp.html b/doc/icecast2_yp.html index 6883d45e..ffc9c3bf 100755 --- a/doc/icecast2_yp.html +++ b/doc/icecast2_yp.html @@ -23,9 +23,9 @@

If icecast has been built with YP support, then the following configuration options control the YP directory settings:

     <directory>
-        <yp-url-timeout>15<yp-url-timeout>
-        <yp-url>http://dir.xiph.org/cgi-bin/yp-cgi<yp-url>
-    <directory>
+        <yp-url-timeout>15</yp-url-timeout>
+        <yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
+    </directory>
 

Multiple directory XML chunks can be specified in order to be listed in multiple directories.


diff --git a/src/connection.c b/src/connection.c index b146e153..8e0ec50a 100644 --- a/src/connection.c +++ b/src/connection.c @@ -752,7 +752,7 @@ static void _handle_get_request(connection_t *con, int bytes; struct stat statbuf; int fileserve; - char *host; + char *host = NULL; int port; int i; char *serverhost = NULL; @@ -765,7 +765,8 @@ static void _handle_get_request(connection_t *con, DEBUG1("start with %s", passed_uri); config = config_get_config(); fileserve = config->fileserve; - host = config->hostname; + if (config->hostname) + host = strdup (config->hostname); port = config->port; for(i = 0; i < MAX_LISTEN_SOCKETS; i++) { if(global.serversock[i] == con->serversock) { @@ -807,6 +808,7 @@ static void _handle_get_request(connection_t *con, (strncmp(uri, "/admin/", 7) == 0)) { admin_handle_request(client, uri); if (uri != passed_uri) free (uri); + free (host); return; } @@ -831,6 +833,7 @@ static void _handle_get_request(connection_t *con, } free(fullpath); if (uri != passed_uri) free (uri); + free (host); return; } else if(fileserve && stat(fullpath, &statbuf) == 0 && @@ -843,6 +846,7 @@ static void _handle_get_request(connection_t *con, fserve_client_create(client, fullpath); free(fullpath); if (uri != passed_uri) free (uri); + free (host); return; } free(fullpath); @@ -864,8 +868,10 @@ static void _handle_get_request(connection_t *con, client_destroy(client); free(sourceuri); if (uri != passed_uri) free (uri); + free (host); return; } + free (host); global_lock(); if (global.clients >= client_limit)