![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <glib/gi18n.h>#include <stdio.h>#include <stdlib.h>#include <libsoup/soup.h>#include "common/darktable.h"#include "common/http_server.h"
Include dependency graph for http_server.c:Go to the source code of this file.
Data Structures | |
| struct | _connection_t |
Macros | |
| #define | LIBSOUP2 |
Typedefs | |
| typedef struct _connection_t | _connection_t |
Functions | |
| static void | _request_finished_callback (SoupServer *server, SoupMessage *message, SoupClientContext *client, gpointer user_data) |
| static void | _new_connection (SoupServer *server, SoupMessage *msg, const char *path, GHashTable *query, SoupClientContext *client, gpointer user_data) |
| dt_http_server_t * | dt_http_server_create (const int *ports, const int n_ports, const char *id, const dt_http_server_callback callback, gpointer user_data) |
| void | dt_http_server_kill (dt_http_server_t *server) |
Variables | |
| static const char | reply [] |
| #define LIBSOUP2 |
Definition at line 38 of file http_server.c.
| typedef struct _connection_t _connection_t |
|
static |
Definition at line 99 of file http_server.c.
References _request_finished_callback(), dt_free, reply, and TRUE.
Referenced by dt_http_server_create().
|
static |
Definition at line 93 of file http_server.c.
References dt_http_server_kill().
Referenced by _new_connection().
| dt_http_server_t * dt_http_server_create | ( | const int * | ports, |
| const int | n_ports, | ||
| const char * | id, | ||
| const dt_http_server_callback | callback, | ||
| gpointer | user_data | ||
| ) |
create a new http server, listening on one of the ports and using id as its path. the final url can be taken from the returned struct. when a connection is made the callback is called.
Definition at line 173 of file http_server.c.
References _new_connection(), DT_DEBUG_CONTROL, dt_free, dt_print(), i, IS_NULL_PTR, dt_http_server_t::server, and dt_http_server_t::url.
| void dt_http_server_kill | ( | dt_http_server_t * | server | ) |
call this to kill a server manually. don't call this if the request was received. this also frees server.
Definition at line 264 of file http_server.c.
References dt_free, dt_http_server_t::server, and dt_http_server_t::url.
Referenced by _request_finished_callback().
|
static |
Definition at line 49 of file http_server.c.
Referenced by _new_connection().