Re: Need way to tell libsoup "Response will not have body"



On 12/02/2012 06:11 AM, Jens Georg wrote:
> In GUPnP, we have a request method called NOTIFY for unicast eventing. This is
> called on a URI and has some headers and an XML body.
> 
> The response to this request is bodyless. We're using HTTP1.1 with keep-alive
> here. Most clients include a Content-Length: 0 header in the response, but this
> is not required by the standard.

Which standard exactly? HTTP/1.1 says that all responses have a body
unless the method is HEAD or the status code is 204 or 304.

> Is there any way to tell libsoup "There won't be a body, no need for waiting"?
> I tried modifying the response header in "got-headers" or setting the encoding
> before sending the message, but that didn't help

Inserting "Content-Length: 0" from "got-headers" won't work, but
inserting "Connection: close" from there should. Also, this is not
supported, but you could connect to "notify::status-code" and change the
encoding headers from there, and it would work.

But if there's some UPnP-related standard that defines NOTIFY as not
having a response body, then we could adjust libsoup's HTTP code to know
about that...

-- Dan



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