From d87c966ec5f17d5fbef1b409f426c0d70cd6231f Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Thu, 23 Feb 2012 15:20:22 -0200 Subject: [PATCH] SF Bug Tracker: http lib only accepts HTTP/1.1 - ID:3485745 Submitted by Berend Dekens ( Berend Dekens ) - 2012-02-08 06:24:31 PST In httpparser.c on line 1385 it says that HTTP 1.0 replies are blocked because the UPnP verfication tool requires this. I looked in the specs and as far as I can find, one should only be carefull to send chunked communication to hosts supporting HTTP 1.1. There is no requirement to support only HTTP 1.1. The XBMC media server uses the Platinum UPnP library which replies using HTTP/1.0 messages. As it is now, libupnp returns an error while trying to parse the response while the response itself is completely valid. Is there a requirement in the UPnP 1.0 spec that I missed or is this restriction self-imposed? And can it be lifted? ------------------------------------------------------------------- Comment by Fabrice Fontaine: Hide Hi, You're right, this modification should be removed. This version checking was wrongly added in parser_parse_responseline function. ... --- ChangeLog | 5 +++++ upnp/src/genlib/net/http/httpparser.c | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea582fa..4bd3a41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ Version 1.6.16 ******************************************************************************* +2012-02-23 Marcelo Roberto Jimenez + + Revert cb89781a55466703763c1b0ee67094eb401ddfe9 as suggested by + Fabrice Fontaine. + 2012-02-07 Edwin Stearns Attached is a patch that resolved an issue I found with a server that diff --git a/upnp/src/genlib/net/http/httpparser.c b/upnp/src/genlib/net/http/httpparser.c index 5a193cc..ccfaa59 100644 --- a/upnp/src/genlib/net/http/httpparser.c +++ b/upnp/src/genlib/net/http/httpparser.c @@ -1378,10 +1378,9 @@ parse_status_t parser_parse_responseline(INOUT http_parser_t *parser) &hmsg->major_version, &hmsg->minor_version, &hmsg->status_code); line.buf[line.length] = save_char; /* restore */ - if (num_scanned != 3 || hmsg->major_version < 0 || - /* HTTP version equals to 1.0 should fail as required by the - * UPnP certification tool */ - hmsg->minor_version < 1 || hmsg->status_code < 0) + if (num_scanned != 3 || + hmsg->major_version < 0 || hmsg->minor_version < 0 || + hmsg->status_code < 0) /* bad response line */ return PARSE_FAILURE; /* point to status msg */