From b0df81345a4562288d3bc3866872317b27c80c5a Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Wed, 30 Nov 2011 23:53:00 +0000 Subject: * Try to set the network interface number based on the client address, in case there is no Host header from an HTTP 1.0 request. --- upnphttp.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/upnphttp.c b/upnphttp.c index ba7f5b5..f70f452 100644 --- a/upnphttp.c +++ b/upnphttp.c @@ -776,6 +776,18 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h) HttpVer[i] = '\0'; /*DPRINTF(E_INFO, L_HTTP, "HTTP REQUEST : %s %s (%s)\n", HttpCommand, HttpUrl, HttpVer);*/ + + /* set the interface here initially, in case there is no Host header */ + for(i = 0; iclientaddr.s_addr & lan_addr[i].mask.s_addr) + == (lan_addr[i].addr.s_addr & lan_addr[i].mask.s_addr)) + { + h->iface = i; + break; + } + } + ParseHttpHeaders(h); /* see if we need to wait for remaining data */ @@ -821,7 +833,7 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h) Send400(h); return; } - #if 1 /* 7.3.33.4 */ + /* 7.3.33.4 */ else if( ((h->reqflags & FLAG_TIMESEEK) || (h->reqflags & FLAG_PLAYSPEED)) && !(h->reqflags & FLAG_RANGE) ) { @@ -830,7 +842,6 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h) Send406(h); return; } - #endif else if(strcmp("GET", HttpCommand) == 0) { h->req_command = EGet; -- cgit v1.2.3