Re: Quick question regarding recent SOUP_ENCODING_EOF code



W. Michael Petullo wrote:
> Everything works when I use chunked encoding. Only when I use the new
> EOF encoding do I have this problem. The only difference between the two
> cases is:
> 
> if (soup_message_get_http_version (message) == SOUP_HTTP_1_0) {
>     soup_message_headers_set_encoding (message->response_headers,
> SOUP_ENCODING_EOF);
> } else {
>     soup_message_headers_set_encoding (message->response_headers,
> SOUP_ENCODING_CHUNKED);
> }

Hm... and changing streaming-test to use HTTP/1.0 doesn't break it, so
it's not that.

> I do use soup_server_unpause_message () in my write_next_chunk ()
> callback.

The only time you need to call unpause_message (assuming you didn't
pause the message yourself) is if you let the message body "underflow"
by not having the next chunk ready after the last one was sent. In the
code you quoted, this wouldn't happen, so you shouldn't need to use
unpause. (That said, I tried adding a gratuitous unpause() to
streaming-test, and that didn't break it either, so this is also
probably not your problem.)

> The following works fine when using chunked encoding (writes
> "wrote 0 bytes, sending message complete" once and stops getting called)
> but not when using EOF encoding (called over and over, printing "wrote 0
> bytes, sending message complete" repeatedly)

Bizarre. Is your code available in svn or git or something somewhere
that I can see it/try it?

-- Dan


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