mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-10 14:09:51 -05:00
Add support for getting Shoutcast (ICY) metadata from internet streams
This commit is contained in:
@@ -239,6 +239,13 @@ struct {
|
||||
* the regular callback.
|
||||
*/
|
||||
void (*chunk_cb)(struct evhttp_request *, void *);
|
||||
|
||||
/*
|
||||
* Callback added for forked-daapd so we can collect ICY
|
||||
* (shoutcast) metadata from the http header. If return
|
||||
* int is negative the connection will be closed.
|
||||
*/
|
||||
int (*header_cb)(struct evhttp_request *, void *);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1656,6 +1656,14 @@ evhttp_read_header(struct evhttp_connection *evcon, struct evhttp_request *req)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Callback can shut down connection with negative return value */
|
||||
if (req->header_cb != NULL) {
|
||||
if ((*req->header_cb)(req, req->cb_arg) < 0) {
|
||||
evhttp_connection_fail(evcon, EVCON_HTTP_EOF);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Done reading headers, do the real work */
|
||||
switch (req->kind) {
|
||||
case EVHTTP_REQUEST:
|
||||
|
||||
Reference in New Issue
Block a user