* 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.

This commit is contained in:
Justin Maggard 2011-11-30 23:53:00 +00:00
parent c38eb01179
commit 9ec2fd2550

View File

@ -776,6 +776,18 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h)
HttpVer[i] = '\0'; HttpVer[i] = '\0';
/*DPRINTF(E_INFO, L_HTTP, "HTTP REQUEST : %s %s (%s)\n", /*DPRINTF(E_INFO, L_HTTP, "HTTP REQUEST : %s %s (%s)\n",
HttpCommand, HttpUrl, HttpVer);*/ 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); ParseHttpHeaders(h);
/* see if we need to wait for remaining data */ /* see if we need to wait for remaining data */
@ -821,7 +833,7 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h)
Send400(h); Send400(h);
return; return;
} }
#if 1 /* 7.3.33.4 */ /* 7.3.33.4 */
else if( ((h->reqflags & FLAG_TIMESEEK) || (h->reqflags & FLAG_PLAYSPEED)) && else if( ((h->reqflags & FLAG_TIMESEEK) || (h->reqflags & FLAG_PLAYSPEED)) &&
!(h->reqflags & FLAG_RANGE) ) !(h->reqflags & FLAG_RANGE) )
{ {
@ -830,7 +842,6 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h)
Send406(h); Send406(h);
return; return;
} }
#endif
else if(strcmp("GET", HttpCommand) == 0) else if(strcmp("GET", HttpCommand) == 0)
{ {
h->req_command = EGet; h->req_command = EGet;