mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-11 06:20:17 -05:00
[http/spotify] Add support for http sessions across multiple requests
This change allows to reuse curl handles for multiple requests. Reusing a curl handle improves performance if more than one request is made against a service (connection, session cache, dns cache are kept between requests).
This commit is contained in:
@@ -194,7 +194,7 @@ streamurl_process(struct input_metadata *metadata, const char *url)
|
||||
client.input_headers = &kv;
|
||||
client.input_body = evbuf;
|
||||
|
||||
ret = http_client_request(&client);
|
||||
ret = http_client_request(&client, NULL);
|
||||
if (ret < 0 || client.response_code != HTTP_OK)
|
||||
{
|
||||
DPRINTF(E_WARN, L_PLAYER, "Request for StreamUrl resource '%s' failed, response code %d\n", url, client.response_code);
|
||||
|
||||
@@ -228,7 +228,7 @@ https_get_cb(char **out, const char *url)
|
||||
ctx.url = url;
|
||||
ctx.input_body = evbuffer_new();
|
||||
|
||||
ret = http_client_request(&ctx);
|
||||
ret = http_client_request(&ctx, NULL);
|
||||
if (ret < 0 || ctx.response_code != HTTP_OK)
|
||||
{
|
||||
DPRINTF(E_LOG, L_SPOTIFY, "Failed to AP list from '%s' (return %d, error code %d)\n", ctx.url, ret, ctx.response_code);
|
||||
|
||||
Reference in New Issue
Block a user