myMPD session functions
More...
#include "dist/mongoose/mongoose.h"
#include "dist/sds/sds.h"
#include "src/lib/api.h"
#include "src/lib/list.h"
#include "src/webserver/utility.h"
#include <stdbool.h>
Go to the source code of this file.
◆ webserver_session_api()
void webserver_session_api |
( |
struct mg_connection * |
nc, |
|
|
enum mympd_cmd_ids |
cmd_id, |
|
|
sds |
body, |
|
|
unsigned |
request_id, |
|
|
sds |
session, |
|
|
struct t_mg_user_data * |
mg_user_data |
|
) |
| |
Request handler for the session api
- Parameters
-
nc | mongoose connection |
cmd_id | jsonrpc method |
body | http body (jsonrpc request) |
request_id | jsonrpc request id |
session | session hash |
mg_user_data | webserver configuration |
◆ webserver_session_new()
sds webserver_session_new |
( |
struct t_list * |
session_list | ) |
|
Creates a new session
- Parameters
-
session_list | the session list |
- Returns
- newly allocated sds string with the session hash or NULL on error
◆ webserver_session_remove()
bool webserver_session_remove |
( |
struct t_list * |
session_list, |
|
|
const char * |
session |
|
) |
| |
- Parameters
-
session_list | the session list |
session | session hash to remove |
- Returns
- true on success, else false
◆ webserver_session_validate()
bool webserver_session_validate |
( |
struct t_list * |
session_list, |
|
|
const char * |
session |
|
) |
| |
Validates a session
- Parameters
-
session_list | the session list |
session | session hash to validate |
- Returns
- true on success, else false