mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-31 01:33:44 -04:00
Rework iTunes 9 absolute request uri fix
This commit is contained in:
parent
f8f183f2f6
commit
946758cec7
@ -1675,10 +1675,9 @@ daap_stream(struct evhttp_request *req, struct evbuffer *evbuf, char **uri, stru
|
|||||||
static char *
|
static char *
|
||||||
daap_fix_request_uri(struct evhttp_request *req, char *uri)
|
daap_fix_request_uri(struct evhttp_request *req, char *uri)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
char *ret;
|
char *ret;
|
||||||
|
|
||||||
/* iTunes 9 gives us a request-uri like
|
/* iTunes 9 gives us an absolute request-uri like
|
||||||
* daap://10.1.1.20:3689/server-info
|
* daap://10.1.1.20:3689/server-info
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -1686,20 +1685,16 @@ daap_fix_request_uri(struct evhttp_request *req, char *uri)
|
|||||||
return uri;
|
return uri;
|
||||||
|
|
||||||
/* Clear the proxy request flag set by evhttp
|
/* Clear the proxy request flag set by evhttp
|
||||||
* due to the request URI beginning with daap://
|
* due to the request URI being absolute.
|
||||||
* It has side-effects on Connection: keep-alive
|
* It has side-effects on Connection: keep-alive
|
||||||
*/
|
*/
|
||||||
req->flags &= ~EVHTTP_PROXY_REQUEST;
|
req->flags &= ~EVHTTP_PROXY_REQUEST;
|
||||||
|
|
||||||
ret = uri - 1;
|
ret = strchr(uri + strlen("daap://"), '/');
|
||||||
for (i = 0; i < 3; i++)
|
if (!ret)
|
||||||
{
|
{
|
||||||
ret = strchr(ret + 1, '/');
|
DPRINTF(E_LOG, L_DAAP, "Malformed DAAP Request URI '%s'\n", uri);
|
||||||
if (!ret)
|
return NULL;
|
||||||
{
|
|
||||||
DPRINTF(E_LOG, L_DAAP, "Malformed DAAP Request URI '%s'\n", uri);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user