myMPD
Internal API documentation
Loading...
Searching...
No Matches
request_handler.c File Reference

HTTP request handler. More...

#include "compile_time.h"
#include "src/webserver/request_handler.h"
#include "src/lib/api.h"
#include "src/lib/json/json_print.h"
#include "src/lib/json/json_query.h"
#include "src/lib/json/json_rpc.h"
#include "src/lib/log.h"
#include "src/lib/sds/sds_extras.h"
#include "src/webserver/lyrics.h"
#include "src/webserver/proxy.h"
#include "src/webserver/response.h"
#include "src/webserver/sessions.h"
#include "src/webserver/utility.h"
#include "src/webserver/webradio.h"
Include dependency graph for request_handler.c:

Functions

bool request_handler_api (struct mg_connection *nc, sds body, struct mg_str *auth_header, struct t_mg_user_data *mg_user_data)
bool request_handler_script_api (struct mg_connection *nc, sds body)
void request_handler_browse (struct mg_connection *nc, struct mg_http_message *hm, struct t_mg_user_data *mg_user_data)
void request_handler_proxy (struct mg_connection *nc, struct mg_http_message *hm, struct mg_connection *backend_nc)
void request_handler_proxy_covercache (struct mg_connection *nc, struct mg_http_message *hm, struct mg_connection *backend_nc)
void request_handler_serverinfo (struct mg_connection *nc)
void request_handler_ca (struct mg_connection *nc, struct mg_http_message *hm, struct t_mg_user_data *mg_user_data)
void request_handler_extm3u (struct mg_connection *nc, struct mg_http_message *hm, struct t_mg_user_data *mg_user_data)

Detailed Description

HTTP request handler.

Function Documentation

◆ request_handler_api()

bool request_handler_api ( struct mg_connection * nc,
sds body,
struct mg_str * auth_header,
struct t_mg_user_data * mg_user_data )

Request handler for api requests /api

Parameters
ncmongoose connection
bodyhttp body (jsonrpc request)
auth_headerAuthentication header (myMPD session)
mg_user_datawebserver configuration
Returns
true on success, else false

◆ request_handler_browse()

void request_handler_browse ( struct mg_connection * nc,
struct mg_http_message * hm,
struct t_mg_user_data * mg_user_data )

Request handler for /browse

Parameters
ncmongoose connection
hmhttp message
mg_user_datawebserver configuration

◆ request_handler_ca()

void request_handler_ca ( struct mg_connection * nc,
struct mg_http_message * hm,
struct t_mg_user_data * mg_user_data )

Request handler for /ca.crt

Parameters
ncmongoose connection
hmhttp message
mg_user_datawebserver configuration

◆ request_handler_extm3u()

void request_handler_extm3u ( struct mg_connection * nc,
struct mg_http_message * hm,
struct t_mg_user_data * mg_user_data )

Request handler for /webradio to retrieve an extm3u for a webradio. Sends the request to the mympd_api thread.

Parameters
ncmongoose connection
hmhttp message
mg_user_datawebserver configuration

◆ request_handler_proxy()

void request_handler_proxy ( struct mg_connection * nc,
struct mg_http_message * hm,
struct mg_connection * backend_nc )

Request handler for proxy connections /proxy

Parameters
ncmongoose connection
hmhttp body
backend_ncmongoose backend connection

◆ request_handler_proxy_covercache()

void request_handler_proxy_covercache ( struct mg_connection * nc,
struct mg_http_message * hm,
struct mg_connection * backend_nc )

Request handler for proxy connections /proxy-covercache

Parameters
ncmongoose connection
hmhttp body
backend_ncmongoose backend connection

◆ request_handler_script_api()

bool request_handler_script_api ( struct mg_connection * nc,
sds body )

Request handler for script api requests /api/script

Parameters
ncmongoose connection
bodyhttp body (jsonrpc request)
Returns
true on success, else false

◆ request_handler_serverinfo()

void request_handler_serverinfo ( struct mg_connection * nc)

Request handler for /serverinfo

Parameters
ncmongoose connection