Open Lighting Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
ola::http Namespace Reference

Detailed Description

The embedded HTTP server.

Classes

class  HTTPRequest
class  HTTPResponse
class  HTTPServer
class  OlaHTTPServer

Functions

static int AddHeaders (void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
int IteratePost (void *request_cls, enum MHD_ValueKind kind, const char *key, const char *filename, const char *content_type, const char *transfer_encoding, const char *data, uint64_t off, size_t size)
static int HandleRequest (void *http_server_ptr, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **ptr)
void RequestCompleted (void *, struct MHD_Connection *, void **request_cls, enum MHD_RequestTerminationCode)

Function Documentation

static int ola::http::AddHeaders ( void *  cls,
enum MHD_ValueKind  kind,
const char *  key,
const char *  value 
)
static

Called by MHD_get_connection_values to add headers to a request obect.

Parameters
clsa pointer to an HTTPRequest object.
keythe header name
valuethe header value
static int ola::http::HandleRequest ( void *  http_server_ptr,
struct MHD_Connection *  connection,
const char *  url,
const char *  method,
const char *  version,
const char *  upload_data,
size_t *  upload_data_size,
void **  ptr 
)
static

Called whenever a new request is made. This sets up HTTPRequest & HTTPResponse objects and then calls DispatchRequest.

int ola::http::IteratePost ( void *  request_cls,
enum MHD_ValueKind  kind,
const char *  key,
const char *  filename,
const char *  content_type,
const char *  transfer_encoding,
const char *  data,
uint64_t  off,
size_t  size 
)

Called by MHD_create_post_processor to iterate over the post form data

Parameters
request_clsa pointer to a HTTPRequest object
keythe header name
valuethe header value
void ola::http::RequestCompleted ( void *  ,
struct MHD_Connection *  ,
void **  request_cls,
enum  MHD_RequestTerminationCode 
)

Called when a request completes. This deletes the associated HTTPRequest object.