aboutsummaryrefslogtreecommitdiffstats
path: root/main/http.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-18 22:32:26 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-18 22:32:26 +0000
commit93531c68a25e6424e8f8b93f4bf3c944fdc53440 (patch)
tree359e80b11b9aeec274ca5fe62c4b6a075d487417 /main/http.c
parent28ef6ff72905b4d9229de9edf95682f958ba2fa5 (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: http://svn.digium.com/svn/asterisk/trunk@109762 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/http.c')
-rw-r--r--main/http.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/main/http.c b/main/http.c
index 13dfb5e72..c3df5af42 100644
--- a/main/http.c
+++ b/main/http.c
@@ -32,8 +32,6 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#include "asterisk/paths.h" /* use ast_config_AST_DATA_DIR */
-#include "asterisk/network.h"
#include <time.h>
#include <sys/time.h>
#include <sys/stat.h>
@@ -44,6 +42,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <gmime/gmime.h>
#endif /* ENABLE_UPLOADS */
+#include "asterisk/paths.h" /* use ast_config_AST_DATA_DIR */
+#include "asterisk/network.h"
#include "asterisk/cli.h"
#include "asterisk/tcptls.h"
#include "asterisk/http.h"
@@ -53,6 +53,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/stringfields.h"
#include "asterisk/ast_version.h"
#include "asterisk/manager.h"
+#include "asterisk/_private.h"
#define MAX_PREFIX 80
@@ -145,7 +146,8 @@ static const char *ftype2mtype(const char *ftype, char *wkspace, int wkspacelen)
return wkspace;
}
-static struct ast_str *static_callback(struct ast_tcptls_session_instance *ser, const char *uri, struct ast_variable *vars, int *status, char **title, int *contentlength)
+static struct ast_str *static_callback(struct ast_tcptls_session_instance *ser, const char *uri, enum ast_http_method method,
+ struct ast_variable *vars, int *status, char **title, int *contentlength)
{
char *path;
char *ftype;
@@ -215,7 +217,8 @@ out403:
}
-static struct ast_str *httpstatus_callback(struct ast_tcptls_session_instance *ser, const char *uri, struct ast_variable *vars, int *status, char **title, int *contentlength)
+static struct ast_str *httpstatus_callback(struct ast_tcptls_session_instance *ser, const char *uri, enum ast_http_method method,
+ struct ast_variable *vars, int *status, char **title, int *contentlength)
{
struct ast_str *out = ast_str_create(512);
struct ast_variable *v;
@@ -641,7 +644,7 @@ static struct ast_str *handle_uri(struct ast_tcptls_session_instance *ser, char
if (urih) {
if (urih->static_content)
*static_content = 1;
- out = urih->callback(ser, uri, vars, status, title, contentlength);
+ out = urih->callback(ser, uri, AST_HTTP_GET, vars, status, title, contentlength);
AST_RWLIST_UNLOCK(&uris);
} else {
out = ast_http_error(404, "Not Found", NULL,