Merge pull request #132 from chme/m3ustream

Problem opening stream - error code 404
This commit is contained in:
ejurgensen 2015-04-18 21:45:02 +02:00
commit 09b8086ba3

View File

@ -186,6 +186,11 @@ http_client_request(struct http_client_ctx *ctx)
return ctx->ret;
}
if (port <= 0)
snprintf(s, PATH_MAX, "%s", hostname);
else
snprintf(s, PATH_MAX, "%s:%d", hostname, port);
if (port <= 0)
port = 80;
@ -231,7 +236,6 @@ http_client_request(struct http_client_ctx *ctx)
#endif
headers = evhttp_request_get_output_headers(req);
snprintf(s, PATH_MAX, "%s:%d", hostname, port);
evhttp_add_header(headers, "Host", s);
evhttp_add_header(headers, "Content-Length", "0");
evhttp_add_header(headers, "User-Agent", "forked-daapd/" VERSION);