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



On Mo, 2012-12-03 at 08:33 -0500, Dan Winship wrote:
> 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.

The UPnP UDA (1.0[1] and 1.1[2]) standard, defining the GENA (HTTP
notification) protocol.

> > 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.

Ok, I'll try those, thanks.

> 
> 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...

Not sure if it's worth cluttering libsoup with that. Also might
potentially problematic if some other standard defines a NOTIFY method
with a response body.

[1] http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.0.pdf,
4.2.1 (especially pg, 71, parapgraph 2)
[2] http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf,
4.3.2 (esp. pg 100, paragraph 4)




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