Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforce.net>2011-12-01 03:53:00 +0400
committerJustin Maggard <jmaggard@users.sourceforce.net>2011-12-01 03:53:00 +0400
commitb0df81345a4562288d3bc3866872317b27c80c5a (patch)
treeb65c0153674abf38e14157a890ed0c80e02e2daf
parentdd1cb4f67ba4f0251e971e8ef1a4a03dc508c0f9 (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.c15
1 files 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; 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;