httpd.h File Reference

#include <isc/event.h>
#include <isc/eventclass.h>
#include <isc/types.h>
#include <isc/mutex.h>
#include <isc/task.h>
#include <isc/time.h>

Go to the source code of this file.

Data Structures

struct  isc_httpdurl
 HTTP urls. These are the URLs we manage, and the function to call to provide the data for it. We pass in the base url (so the same function can handle multiple requests), and a structure to fill in to return a result to the client. We also pass in a pointer to be filled in for the data cleanup function. More...

Defines

#define ISC_HTTPD_H   1
#define HTTPD_EVENTCLASS   ISC_EVENTCLASS(4300)
#define HTTPD_SHUTDOWN   (HTTPD_EVENTCLASS + 0x0001)
#define ISC_HTTPDMGR_FLAGSHUTTINGDOWN   0x00000001

Functions

isc_result_t isc_httpdmgr_create (isc_mem_t *mctx, isc_socket_t *sock, isc_task_t *task, isc_httpdclientok_t *client_ok, isc_httpdondestroy_t *ondestory, void *cb_arg, isc_timermgr_t *tmgr, isc_httpdmgr_t **httpdp)
void isc_httpdmgr_shutdown (isc_httpdmgr_t **httpdp)
isc_result_t isc_httpdmgr_addurl (isc_httpdmgr_t *httpdmgr, const char *url, isc_httpdaction_t *func, void *arg)
isc_result_t isc_httpdmgr_addurl2 (isc_httpdmgr_t *httpdmgr, const char *url, isc_boolean_t isstatic, isc_httpdaction_t *func, void *arg)
isc_result_t isc_httpd_response (isc_httpd_t *httpd)
isc_result_t isc_httpd_addheader (isc_httpd_t *httpd, const char *name, const char *val)
isc_result_t isc_httpd_addheaderuint (isc_httpd_t *httpd, const char *name, int val)
isc_result_t isc_httpd_endheaders (isc_httpd_t *httpd)


Detailed Description

Definition in file httpd.h.


Define Documentation

#define ISC_HTTPD_H   1

Definition at line 20 of file httpd.h.

#define HTTPD_EVENTCLASS   ISC_EVENTCLASS(4300)

Definition at line 47 of file httpd.h.

#define HTTPD_SHUTDOWN   (HTTPD_EVENTCLASS + 0x0001)

Definition at line 48 of file httpd.h.

#define ISC_HTTPDMGR_FLAGSHUTTINGDOWN   0x00000001

Definition at line 50 of file httpd.h.


Function Documentation

isc_result_t isc_httpdmgr_create ( isc_mem_t mctx,
isc_socket_t sock,
isc_task_t task,
isc_httpdclientok_t client_ok,
isc_httpdondestroy_t ondestory,
void *  cb_arg,
isc_timermgr_t tmgr,
isc_httpdmgr_t **  httpdp 
)

Definition at line 236 of file httpd.c.

References isc_httpdmgr::cb_arg, cleanup(), isc_httpdmgr::client_ok, isc_httpd_accept(), ISC_LIST_INIT, isc_mem_attach(), isc_mem_detach(), isc_mem_get, isc_mem_put, isc_mutex_destroy, isc_mutex_init, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_result_totext(), isc_socket_accept(), isc_socket_attach(), isc_socket_detach(), isc_socket_filter(), isc_socket_listen(), isc_task_attach(), isc_task_detach(), isc_httpdmgr::mctx, isc_httpdmgr::ondestroy, REQUIRE, isc_httpdmgr::sock, isc_httpdmgr::task, isc_httpdmgr::timermgr, and UNEXPECTED_ERROR.

Referenced by add_listener().

void isc_httpdmgr_shutdown ( isc_httpdmgr_t **  httpdp  ) 

Definition at line 767 of file httpd.c.

References ENTER, EXIT, ISC_LIST_HEAD, ISC_LIST_NEXT, ISC_SOCKCANCEL_ALL, isc_socket_cancel(), LOCK, MSETSHUTTINGDOWN, isc_httpdmgr::sock, isc_httpdmgr::task, and UNLOCK.

Referenced by shutdown_listener().

isc_result_t isc_httpdmgr_addurl ( isc_httpdmgr_t httpdmgr,
const char *  url,
isc_httpdaction_t func,
void *  arg 
)

Definition at line 996 of file httpd.c.

References ISC_FALSE, and isc_httpdmgr_addurl2().

Referenced by add_listener().

isc_result_t isc_httpdmgr_addurl2 ( isc_httpdmgr_t httpdmgr,
const char *  url,
isc_boolean_t  isstatic,
isc_httpdaction_t func,
void *  arg 
)

Definition at line 1003 of file httpd.c.

References isc_httpdurl::action, isc_httpdurl::action_arg, ISC_LINK_INIT, ISC_LIST_APPEND, isc_mem_get, isc_mem_put, isc_mem_strdup, ISC_R_NOMEMORY, ISC_R_SUCCESS, isc_time_now(), isc_httpdurl::isstatic, isc_httpdurl::loadtime, isc_httpdmgr::mctx, and isc_httpdurl::url.

Referenced by add_listener(), and isc_httpdmgr_addurl().

isc_result_t isc_httpd_response ( isc_httpd_t httpd  ) 

Definition at line 815 of file httpd.c.

References grow_headerspace(), isc_buffer_add, isc_buffer_availablelength, isc_buffer_used, and ISC_R_SUCCESS.

Referenced by isc_httpd_recvdone().

isc_result_t isc_httpd_addheader ( isc_httpd_t httpd,
const char *  name,
const char *  val 
)

Definition at line 837 of file httpd.c.

References grow_headerspace(), isc_buffer_add, isc_buffer_availablelength, isc_buffer_used, and ISC_R_SUCCESS.

Referenced by isc_httpd_recvdone().

isc_result_t isc_httpd_addheaderuint ( isc_httpd_t httpd,
const char *  name,
int  val 
)

Definition at line 883 of file httpd.c.

References grow_headerspace(), isc_buffer_add, isc_buffer_availablelength, isc_buffer_used, and ISC_R_SUCCESS.

Referenced by isc_httpd_recvdone().

isc_result_t isc_httpd_endheaders ( isc_httpd_t httpd  ) 

Definition at line 867 of file httpd.c.

References grow_headerspace(), isc_buffer_add, isc_buffer_availablelength, isc_buffer_used, and ISC_R_SUCCESS.

Referenced by isc_httpd_recvdone().


Generated on Tue Apr 28 17:41:15 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha