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
This commit is contained in:
Kevin P. Fleming
2008-03-18 22:32:26 +00:00
parent 994d025523
commit e191b51a08
5 changed files with 41 additions and 27 deletions

View File

@@ -33,7 +33,9 @@ int ast_device_state_engine_init(void); /*!< Provided by devicestate.c */
int astobj2_init(void); /*!< Provided by astobj2.c */
int ast_file_init(void); /*!< Provided by file.c */
int ast_features_init(void); /*!< Provided by features.c */
void ast_autoservice_init(void); /*!< Provided by autoservice.c */
void ast_autoservice_init(void); /*!< Provided by autoservice.c */
int ast_http_init(void); /*!< Provided by http.c */
int ast_http_reload(void); /*!< Provided by http.c */
/*!
* \brief Reload asterisk modules.

View File

@@ -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;
unsigned int has_subtree:1;
/*! This URI mapping serves static content */
unsigned int static_content:1;
ast_http_callback callback;
unsigned int has_subtree:1;
/*! This handler serves static content */
unsigned int static_content:1;
/*! 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 Unregister a URI handler */
void ast_http_uri_unlink(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 */
void ast_http_uri_unlink(struct ast_http_uri *urihandler);
int ast_http_init(void);
int ast_http_reload(void);
#endif /* _ASTERISK_SRV_H */