GNOME Bugzilla – Bug 572153
SoupServer doesn't support SOUP_ENCODING_EOF
Last modified: 2009-02-19 18:58:53 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.
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.
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
oops, closing