* 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:
parent
c38eb01179
commit
9ec2fd2550
15
upnphttp.c
15
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user