Commit 235a2639 authored by Jack Moffitt's avatar Jack Moffitt
Browse files

Ouch. Serious bug found by Ricardo Galli.

When the cond var is signalled it will wake up a thread.  If all the
connection handler threads are handling connections, the signal will be
ignored and clients will 'pend' until another client causes the to signal

We have to check to see if there are more pending connections before waiting
on the signal again.

svn path=/trunk/icecast/; revision=3178
parent 785cfefe
......@@ -310,8 +310,7 @@ static void *_handle_connection(void *arg)
if (global.running != ICE_RUNNING) break;
/* grab a connection and set the socket to blocking */
con = _get_connection();
while (con = _get_connection()) {
stats_event_inc(NULL, "connections");
sock_set_blocking(con->sock, SOCK_BLOCK);
......@@ -385,14 +384,13 @@ static void *_handle_connection(void *arg)
if (contenttype != NULL) {
format_type_t format = format_get_type(contenttype);
if(format < 0) {
if (format < 0) {
WARN1("Content-type \"%s\" not supported, dropping source", contenttype);
} else {
source = source_create(con, parser, httpp_getvar(parser, HTTPP_VAR_URI), format);
else {
} else {
WARN0("No content-type header, cannot handle source");
......@@ -533,6 +531,7 @@ static void *_handle_connection(void *arg)
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