cURL / Mailing Lists / curl-library / Single Mail

curl-library

[BUG] libCURL 7.16.1 and up breaks streaming.

From: Tobias Rundström <tru_at_xmms.org>
Date: Mon, 30 Apr 2007 14:16:44 +0200

Hello,

I have found a bug/miss-feature in libCURL 7.16.1 and up. In XMMS2 we
use libCURL for HTTP streaming (ice/shout cast and friends). Recently
Apple issued a security fix for OSX that included a new version of
libCURL (7.16.1) and at the same time debian sid shipped 7.16.2 as
default. This broke streaming for our users. We where able to find out
that our plugin broke between 7.16.0 and 7.16.1. After careful
debugging and code-reading we have found the problem.

7.16.1 introduces a check for Content-Encoding and Content-Length. If
these headers are not included in the headers the connection will be
closed instead of starting to read the payload. Since almost no
streaming services has these headers set our plugin will stop getting
callback data from libCURL when headers are parsed.

We have tried this by disabling this test and verified that streaming
works as intended.

The code in question is in lib/transfer.c at row 566:

              else {
                k->header = FALSE; /* no more header to parse! */

                if((k->size == -1) && !conn->bits.chunk && !conn->bits.close)
                  /* When connection is not to get closed, but no
                     Content-Length nor Content-Encoding chunked have been
                     received, there is no body in this response. We don't set
                     stop_reading TRUE since that would also prevent necessary
                     authentication actions to take place. */
                  conn->bits.no_body = TRUE;

              }

We suggest that this test should be optional (default TRUE works just
fine). And in the mean-time we would like to know if there is a
workaround to this issue since we probably can't control what versions
of libCURL is shipped with OSX.
Received on 2007-04-30