Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
http_server.c File Reference
#include <glib/gi18n.h>
#include <stdio.h>
#include <stdlib.h>
#include "common/darktable.h"
#include "common/http_server.h"
+ Include dependency graph for http_server.c:

Data Structures

struct  _connection_t
 

Macros

#define SOUP_CHECK_VERSION(x, y, z)   false
 
#define OLD_API
 

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_tdt_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 []
 

Macro Definition Documentation

◆ OLD_API

#define OLD_API

◆ SOUP_CHECK_VERSION

#define SOUP_CHECK_VERSION (   x,
  y,
 
)    false

Typedef Documentation

◆ _connection_t

typedef struct _connection_t _connection_t

Function Documentation

◆ _new_connection()

static void _new_connection ( SoupServer *  server,
SoupMessage *  msg,
const char *  path,
GHashTable *  query,
SoupClientContext *  client,
gpointer  user_data 
)
static

◆ _request_finished_callback()

static void _request_finished_callback ( SoupServer *  server,
SoupMessage *  message,
SoupClientContext *  client,
gpointer  user_data 
)
static

References dt_http_server_kill().

Referenced by _new_connection().

◆ dt_http_server_create()

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.

References _new_connection(), DT_DEBUG_CONTROL, dt_print(), dt_http_server_t::server, and dt_http_server_t::url.

◆ dt_http_server_kill()

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.

References dt_http_server_t::server, and dt_http_server_t::url.

Referenced by _request_finished_callback().

Variable Documentation

◆ reply

const char reply[]
static

Referenced by _new_connection().