GNOME Bugzilla – Bug 475169
Relaxing libsoup checks to accept HTTP from a particular UPnP device
Last modified: 2007-10-02 20:29: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
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.)
Created attachment 95232 [details] [review] Should fix it Only compile tested but as it is simple code, it shouldn't be too broken
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.
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.
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