From 53650e969fb7524f94cf5e2546c00cf98929f962 Mon Sep 17 00:00:00 2001 From: Karl Heyes Date: Sun, 19 Jun 2005 13:50:39 +0000 Subject: [PATCH] allow touch frequency setting to be changed on any YP response. Also pass user agent to YP server svn path=/icecast/trunk/icecast/; revision=9488 --- src/yp.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/yp.c b/src/yp.c index 8b4059f8..e6b158c0 100644 --- a/src/yp.c +++ b/src/yp.c @@ -128,15 +128,15 @@ static int handle_returned_header (void *ptr, size_t size, size_t nmemb, void *s if (yp->sid) sscanf (ptr, "SID: %[^\r\n]", yp->sid); } - if (strncmp (ptr, "TouchFreq: ", 11) == 0) - { - unsigned secs; - sscanf (ptr, "TouchFreq: %u", &secs); - if (secs < 30) - secs = 30; - DEBUG1 ("server touch interval is %u", secs); - yp->touch_interval = secs; - } + } + if (strncmp (ptr, "TouchFreq: ", 11) == 0) + { + unsigned secs; + sscanf (ptr, "TouchFreq: %u", &secs); + if (secs < 30) + secs = 30; + DEBUG1 ("server touch interval is %u", secs); + yp->touch_interval = secs; } return (int)bytes; } @@ -240,6 +240,7 @@ void yp_recheck_config (ice_config_t *config) } if (server->touch_interval < 30) server->touch_interval = 30; + curl_easy_setopt (server->curl, CURLOPT_USERAGENT, ICECAST_VERSION_STRING); curl_easy_setopt (server->curl, CURLOPT_URL, server->url); curl_easy_setopt (server->curl, CURLOPT_HEADERFUNCTION, handle_returned_header); curl_easy_setopt (server->curl, CURLOPT_WRITEFUNCTION, handle_returned_data);