After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 572153 - SoupServer doesn't support SOUP_ENCODING_EOF
SoupServer doesn't support SOUP_ENCODING_EOF
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2009-02-17 14:35 UTC by Dan Winship
Modified: 2009-02-19 18:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dan Winship 2009-02-17 14:35:34 UTC
It ought to be possible to use SOUP_ENCODING_EOF ("response body ends with connection close") from SoupServer (in particular, for streaming a response of unknown size to an HTTP/1.0 client), but this doesn't currently work, because soup-message-io.c:io_write() assumes everything but SOUP_ENCODING_CHUNKED has a Content-Length.
Comment 1 W. Michael Petullo 2009-02-18 02:51:52 UTC
This is needed for dmapd (http://www.flyn.org/projects/dmapd/index.html) in order to do realtime transcoding of audio data before serving it using libsoup. The stream length is not known until transcoding is complete, but transmission must begin immediately. Presently, I am using chunked encoding, but this may not work with clients that support only HTTP 1.0.
Comment 2 Dan Winship 2009-02-19 18:57:59 UTC
fixed in svn, with a test/example in tests/streaming-test.c

for your purposes, you can probably do:

    if (soup_message_get_http_version (msg) == SOUP_HTTP_1_0) {
        soup_message_headers_set_encoding (msg->response_headers,
                                           SOUP_ENCODING_EOF);
    } else {
        soup_message_headers_set_encoding (msg->response_headers,
                                           SOUP_ENCODING_CHUNKED);
    }

and nothing else needs to be different between the two cases
Comment 3 Dan Winship 2009-02-19 18:58:53 UTC
oops, closing