diff options
author | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-12-01 03:53:00 +0400 |
---|---|---|
committer | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-12-01 03:53:00 +0400 |
commit | b0df81345a4562288d3bc3866872317b27c80c5a (patch) | |
tree | b65c0153674abf38e14157a890ed0c80e02e2daf | |
parent | dd1cb4f67ba4f0251e971e8ef1a4a03dc508c0f9 (diff) |
* 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.
-rw-r--r-- | upnphttp.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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; i<n_lan_addr; i++) + { + if( (h->clientaddr.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; |