Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Icecast-Server
Commits
d0bf2c64
Commit
d0bf2c64
authored
Feb 24, 2013
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle yp headers case insensetive, close #1873
svn path=/icecast/trunk/icecast/; revision=18804
parent
7d65014c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
src/yp.c
src/yp.c
+8
-7
No files found.
src/yp.c
View file @
d0bf2c64
...
...
@@ -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
(
strnc
asec
mp
(
ptr
,
"YPResponse: 1"
,
13
)
==
0
)
yp
->
cmd_ok
=
1
;
if
(
strncmp
(
ptr
,
"YPMessage: "
,
11
)
==
0
)
if
(
strnc
asec
mp
(
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
(
strnc
asec
mp
(
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
(
strnc
asec
mp
(
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment