Commit d0bf2c64 authored by Philipp Schafft's avatar Philipp Schafft 🦁

handle yp headers case insensetive, close #1873

svn path=/icecast/trunk/icecast/; revision=18804
parent 7d65014c
......@@ -109,33 +109,34 @@ static int handle_returned_header (void *ptr, size_t size, size_t nmemb, void *s
unsigned bytes = size * nmemb;
/* DEBUG2 ("header from YP is \"%.*s\"", bytes, ptr); */
if (strncmp (ptr, "YPResponse: 1", 13) == 0)
if (strncasecmp (ptr, "YPResponse: 1", 13) == 0)
yp->cmd_ok = 1;
if (strncmp (ptr, "YPMessage: ", 11) == 0)
if (strncasecmp (ptr, "YPMessage: ", 11) == 0)
{
unsigned len = bytes - 11;
free (yp->error_msg);
yp->error_msg = calloc (1, len);
if (yp->error_msg)
sscanf (ptr, "YPMessage: %[^\r\n]", yp->error_msg);
sscanf (ptr + 11, "%[^\r\n]", yp->error_msg);
}
if (yp->process == do_yp_add)
{
if (strncmp (ptr, "SID: ", 5) == 0)
if (strncasecmp (ptr, "SID: ", 5) == 0)
{
unsigned len = bytes - 5;
free (yp->sid);
yp->sid = calloc (1, len);
if (yp->sid)
sscanf (ptr, "SID: %[^\r\n]", yp->sid);
sscanf (ptr + 5, "%[^\r\n]", yp->sid);
}
}
if (strncmp (ptr, "TouchFreq: ", 11) == 0)
if (strncasecmp (ptr, "TouchFreq: ", 11) == 0)
{
unsigned secs;
sscanf (ptr, "TouchFreq: %u", &secs);
if ( sscanf (ptr + 11, "%u", &secs) != 1 )
secs = 0;
if (secs < 30)
secs = 30;
DEBUG1 ("server touch interval is %u", secs);
......
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