mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-04 18:36:02 -05:00
[http] Repair broken libevent 2.0 compability
This commit is contained in:
parent
2ee4988a50
commit
1ab9151489
14
src/http.c
14
src/http.c
@ -163,13 +163,13 @@ request_header_cb(struct evhttp_request *req, void *arg)
|
|||||||
|
|
||||||
ctx = (struct http_client_ctx *)arg;
|
ctx = (struct http_client_ctx *)arg;
|
||||||
|
|
||||||
if (!ctx->headers)
|
if (!ctx->input_headers)
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_HTTP, "BUG: Header callback invoked but caller did not say where to save the headers\n");
|
DPRINTF(E_LOG, L_HTTP, "BUG: Header callback invoked but caller did not say where to save the headers\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
headers_save(ctx->headers, evhttp_request_get_input_headers(req));
|
headers_save(ctx->input_headers, evhttp_request_get_input_headers(req));
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -671,9 +671,9 @@ http_icy_metadata_get(AVFormatContext *fmtctx, int packet_only)
|
|||||||
|
|
||||||
memset(&ctx, 0, sizeof(struct http_client_ctx));
|
memset(&ctx, 0, sizeof(struct http_client_ctx));
|
||||||
ctx.url = fmtctx->filename;
|
ctx.url = fmtctx->filename;
|
||||||
ctx.headers = kv;
|
ctx.input_headers = kv;
|
||||||
ctx.headers_only = 1;
|
ctx.headers_only = 1;
|
||||||
ctx.body = NULL;
|
ctx.input_body = NULL;
|
||||||
|
|
||||||
ret = http_client_request(&ctx);
|
ret = http_client_request(&ctx);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -690,17 +690,17 @@ http_icy_metadata_get(AVFormatContext *fmtctx, int packet_only)
|
|||||||
memset(metadata, 0, sizeof(struct http_icy_metadata));
|
memset(metadata, 0, sizeof(struct http_icy_metadata));
|
||||||
|
|
||||||
got_header = 0;
|
got_header = 0;
|
||||||
if ( (value = keyval_get(ctx.headers, "icy-name")) )
|
if ( (value = keyval_get(ctx.input_headers, "icy-name")) )
|
||||||
{
|
{
|
||||||
metadata->name = strdup(value);
|
metadata->name = strdup(value);
|
||||||
got_header = 1;
|
got_header = 1;
|
||||||
}
|
}
|
||||||
if ( (value = keyval_get(ctx.headers, "icy-description")) )
|
if ( (value = keyval_get(ctx.input_headers, "icy-description")) )
|
||||||
{
|
{
|
||||||
metadata->description = strdup(value);
|
metadata->description = strdup(value);
|
||||||
got_header = 1;
|
got_header = 1;
|
||||||
}
|
}
|
||||||
if ( (value = keyval_get(ctx.headers, "icy-genre")) )
|
if ( (value = keyval_get(ctx.input_headers, "icy-genre")) )
|
||||||
{
|
{
|
||||||
metadata->genre = strdup(value);
|
metadata->genre = strdup(value);
|
||||||
got_header = 1;
|
got_header = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user