After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 475169 - Relaxing libsoup checks to accept HTTP from a particular UPnP device
Relaxing libsoup checks to accept HTTP from a particular UPnP device
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: Dan Winship
Dan Winship
Depends on:
Blocks:
 
 
Reported: 2007-09-09 16:52 UTC by Stephane Loeuillet
Modified: 2007-10-02 20:29 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Should fix it (493 bytes, patch)
2007-09-09 22:02 UTC, Stephane Loeuillet
committed Details | Review

Description Stephane Loeuillet 2007-09-09 16:52:25 UTC
I'm using GUPnP stack, which uses libsoup to parse HTTP requests and responses.

Trying latest version (SVN) with libsoup 2.2.100 (Ubuntu Gutsy), I saw that 
soup_headers_parse_request

didn't like this :

http://pastebin.com/f3b1f9851

NOTIFY * HTTP/1.1 \r\n
HOST: 239.255.255.250:1900\r\n
CACHE-CONTROL: max-age=1800\r\n
Location: http://192.168.1.2:5431/dyndev/uuid:0006-25e9-eac90000b3dc\r\n
NT: upnp:rootdevice\r\n
NTS: ssdp:alive\r\n
SERVER:LINUX/2.4 UPnP/1.0 BRCM400/1.0\r\n
USN: uuid:0006-25e9-eac90000b3dc::upnp:rootdevice\r\n
\r\n

At first, I thought the problem was the missing ' ' after 'SERVER:' but looking to this packet in Wireshark, I saw this awful leading ' ' after HTTP/1.1 and before the first \r\n

Could libsoup be modified to accept this behavior ? (remove leading spaces on first line) or should it be fixed in apps using libsoup ?

Thanks for your time

Corresponding GUPnP bug :
http://bugzilla.openedhand.com/show_bug.cgi?id=499
Comment 1 Dan Winship 2007-09-09 19:50:10 UTC
Hm... I'm not really excited about this, but I guess there are other kludges for broken HTTP implementations in libsoup already.

However, I'm not sure when the next libsoup release will be. (Among other things, HEAD is currently broken because of bug 471389.) So if you want this fixed soon, your best bet is probably to just manually fix up the broken data yourself before passing it to soup_headers_parse_request(). Then it will work with any version of libsoup anyway.

(But I'm keeping this open because I will eventually patch libsoup to cope with it.)
Comment 2 Stephane Loeuillet 2007-09-09 22:02:28 UTC
Created attachment 95232 [details] [review]
Should fix it

Only compile tested but as it is simple code, it shouldn't be too broken
Comment 3 Jorn Baayen 2007-09-10 16:04:45 UTC
Dan, would it be possible to give a rough estimate for a release that would have this bug fixed? I'm trying to determine whether adding the workaround you suggest is going to be necessary.
Comment 4 Dan Winship 2007-09-11 15:32:59 UTC
OK, I've got 471389 figured out now, but libsoup is in hard code freeze for GNOME 2.20. So there won't be a release for GNOME 2.20. There *will* be a release some time before 2.20.1 in mid-October, but I don't know exactly when.
Comment 5 Stephane Loeuillet 2007-10-02 20:29:25 UTC
Closing at it seems it has been commited (see rev933)

r933 | danw | 2007-09-25 02:23:17 +0200 (mar, 25 sep 2007) | 14 lines

        * libsoup/soup-headers.c (soup_headers_parse_request): allow
        erroneous trailing whitespace after HTTP version. #475169

        * tests/header-parsing.c (reqtests): add a test for #475169