diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2008-03-18 22:32:26 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2008-03-18 22:32:26 +0000 |
commit | e191b51a0849ae51b782c9809a9013c960eac392 (patch) | |
tree | 359e80b11b9aeec274ca5fe62c4b6a075d487417 /include/asterisk/http.h | |
parent | 994d0255231dcbcf0a43cea17f15f1ba6e64e8a5 (diff) |
start the process of changing HTTP request dispatching to do it based on *both* URI and method, so that POST support can move into a module; move http.c's private function prototypes into _private.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/http.h')
-rw-r--r-- | include/asterisk/http.h | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/include/asterisk/http.h b/include/asterisk/http.h index 10e75d93e..8dd122e3f 100644 --- a/include/asterisk/http.h +++ b/include/asterisk/http.h @@ -65,29 +65,37 @@ content is specified) \endverbatim */ -typedef struct ast_str *(*ast_http_callback)(struct ast_tcptls_session_instance *ser, const char *uri, struct ast_variable *params, int *status, char **title, int *contentlength); -/*! \brief Definition of a URI reachable in the embedded HTTP server */ +enum ast_http_method { + AST_HTTP_GET = 0, + AST_HTTP_POST, +}; + +typedef struct ast_str *(*ast_http_callback)(struct ast_tcptls_session_instance *ser, const char *uri, enum ast_http_method method, + struct ast_variable *params, int *status, char **title, int *contentlength); + +/*! \brief Definition of a URI handler */ struct ast_http_uri { AST_LIST_ENTRY(ast_http_uri) entry; const char *description; const char *uri; + ast_http_callback callback; unsigned int has_subtree:1; - /*! This URI mapping serves static content */ + /*! This handler serves static content */ unsigned int static_content:1; - ast_http_callback callback; + /*! This handler accepts GET requests */ + unsigned int supports_get:1; + /*! This handler accepts POST requests */ + unsigned int supports_post:1; }; -/*! \brief Link into the Asterisk HTTP server */ +/*! \brief Register a URI handler */ int ast_http_uri_link(struct ast_http_uri *urihandler); -/*! \brief Return an ast_str malloc()'d string containing an HTTP error message */ -struct ast_str *ast_http_error(int status, const char *title, const char *extra_header, const char *text); - -/*! \brief Destroy an HTTP server */ +/*! \brief Unregister a URI handler */ void ast_http_uri_unlink(struct ast_http_uri *urihandler); -int ast_http_init(void); -int ast_http_reload(void); +/*! \brief Return an ast_str malloc()'d string containing an HTTP error message */ +struct ast_str *ast_http_error(int status, const char *title, const char *extra_header, const char *text); #endif /* _ASTERISK_SRV_H */ |