Re: SoupMessage unref



On 03/24/2015 03:22 PM, Iván Aponte wrote:
Hello,

Im currently using libsoup as a server. I have the following problem.
When using chunked encoding data doesn't get out unless I return from
call back which brings me to another problem that when I return from
the callback SoupMessage is deleted. The only way I have found it to
work if I use the wrote_chunk signal but for big files I find this
slower than doing all in one single callback. Is there a way for the
server not to delete SoupMessage.

If you have set msg->response_headers to SOUP_ENCODING_CHUNKED, then it
should automatically be paused when you return if you haven't filled in
the body yet.

But at any rate, the larger problem with your code is that SoupServer is
not thread-safe. You can't fill in the response from another thread. You
have to do it from the server's thread, either by connecting to
wrote-chunk, or by setting up a timeout or something like that.

(Some day there will hopefully be a nicer way to do streaming from
SoupServer, but I don't know when.)

-- Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]