Commit 88ca3654 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Update: Converted the response format for admin requests into a enum

parent 91134b75
This diff is collapsed.
...@@ -29,9 +29,11 @@ ...@@ -29,9 +29,11 @@
#define ADMINTYPE_HYBRID (ADMINTYPE_GENERAL|ADMINTYPE_MOUNT) #define ADMINTYPE_HYBRID (ADMINTYPE_GENERAL|ADMINTYPE_MOUNT)
/* formats */ /* formats */
#define RAW 1 typedef enum {
#define TRANSFORMED 2 ADMIN_FORMAT_RAW,
#define PLAINTEXT 3 ADMIN_FORMAT_TRANSFORMED,
ADMIN_FORMAT_PLAINTEXT
} admin_format_t;
/* special commands */ /* special commands */
#define ADMIN_COMMAND_ERROR (-1) #define ADMIN_COMMAND_ERROR (-1)
...@@ -39,10 +41,10 @@ ...@@ -39,10 +41,10 @@
void admin_handle_request(client_t *client, const char *uri); void admin_handle_request(client_t *client, const char *uri);
void admin_send_response(xmlDocPtr doc, void admin_send_response(xmlDocPtr doc,
client_t *client, client_t *client,
int response, admin_format_t response,
const char *xslt_template); const char *xslt_template);
void admin_add_listeners_to_mount(source_t *source, void admin_add_listeners_to_mount(source_t *source,
xmlNodePtr parent, xmlNodePtr parent,
......
...@@ -507,7 +507,7 @@ int fserve_client_create (client_t *httpclient, const char *path) ...@@ -507,7 +507,7 @@ int fserve_client_create (client_t *httpclient, const char *path)
*eol = '\0'; *eol = '\0';
doc = stats_get_xml (0, reference, httpclient->mode); doc = stats_get_xml (0, reference, httpclient->mode);
free (reference); free (reference);
admin_send_response (doc, httpclient, TRANSFORMED, xslt_playlist_requested); admin_send_response (doc, httpclient, ADMIN_FORMAT_TRANSFORMED, xslt_playlist_requested);
xmlFreeDoc(doc); xmlFreeDoc(doc);
free (fullpath); free (fullpath);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment