[svn-commits] russell: branch russell/http_filetxfer r72669 - in /team/russell/http_filetxf...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 29 14:44:21 CDT 2007


Author: russell
Date: Fri Jun 29 14:44:21 2007
New Revision: 72669

URL: http://svn.digium.com/view/asterisk?view=rev&rev=72669
Log:
adjust args to http callbacks

Modified:
    team/russell/http_filetxfer/include/asterisk/http.h
    team/russell/http_filetxfer/main/http.c
    team/russell/http_filetxfer/main/manager.c

Modified: team/russell/http_filetxfer/include/asterisk/http.h
URL: http://svn.digium.com/view/asterisk/team/russell/http_filetxfer/include/asterisk/http.h?view=diff&rev=72669&r1=72668&r2=72669
==============================================================================
--- team/russell/http_filetxfer/include/asterisk/http.h (original)
+++ team/russell/http_filetxfer/include/asterisk/http.h Fri Jun 29 14:44:21 2007
@@ -147,7 +147,7 @@
    content is specified) 
 \endverbatim
 */
-typedef struct ast_str *(*ast_http_callback)(struct sockaddr_in *requestor, const char *uri, struct ast_variable *params, int *status, char **title, int *contentlength);
+typedef struct ast_str *(*ast_http_callback)(struct server_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 */
 struct ast_http_uri {

Modified: team/russell/http_filetxfer/main/http.c
URL: http://svn.digium.com/view/asterisk/team/russell/http_filetxfer/main/http.c?view=diff&rev=72669&r1=72668&r2=72669
==============================================================================
--- team/russell/http_filetxfer/main/http.c (original)
+++ team/russell/http_filetxfer/main/http.c Fri Jun 29 14:44:21 2007
@@ -145,7 +145,7 @@
 	return wkspace;
 }
 
-static struct ast_str *static_callback(struct sockaddr_in *req, const char *uri, struct ast_variable *vars, int *status, char **title, int *contentlength)
+static struct ast_str *static_callback(struct server_instance *ser, const char *uri, struct ast_variable *vars, int *status, char **title, int *contentlength)
 {
 	struct ast_str *result;
 	char *path;
@@ -213,7 +213,7 @@
 }
 
 
-static struct ast_str *httpstatus_callback(struct sockaddr_in *req, const char *uri, struct ast_variable *vars, int *status, char **title, int *contentlength)
+static struct ast_str *httpstatus_callback(struct server_instance *ser, const char *uri, struct ast_variable *vars, int *status, char **title, int *contentlength)
 {
 	struct ast_str *out = ast_str_create(512);
 	struct ast_variable *v;
@@ -541,7 +541,7 @@
 	return ast_http_error(200, "OK", NULL, "File successfully uploaded.");
 }
 
-static struct ast_str *handle_uri(struct sockaddr_in *sin, char *uri, int *status, 
+static struct ast_str *handle_uri(struct server_instance *ser, char *uri, int *status, 
 	char **title, int *contentlength, struct ast_variable **cookies, 
 	unsigned int *static_content)
 {
@@ -627,7 +627,7 @@
 	if (urih) {
 		if (urih->static_content)
 			*static_content = 1;
-		out = urih->callback(sin, uri, vars, status, title, contentlength);
+		out = urih->callback(ser, uri, vars, status, title, contentlength);
 		AST_RWLIST_UNLOCK(&uris);
 	} else {
 		out = ast_http_error(404, "Not Found", NULL,
@@ -834,14 +834,12 @@
 		out = ast_http_error(501, "Not Implemented", NULL,
 			"Attempt to use unimplemented / unsupported method");
 	else	/* try to serve it */
-		out = handle_uri(&ser->requestor, uri, &status, &title, &contentlength, &vars, &static_content);
+		out = handle_uri(ser, uri, &status, &title, &contentlength, &vars, &static_content);
 
 	/* If they aren't mopped up already, clean up the cookies */
 	if (vars)
 		ast_variables_destroy(vars);
 
-	if (out == NULL)
-		out = ast_http_error(500, "Internal Error", NULL, "Internal Server Error");
 	if (out) {
 		time_t t = time(NULL);
 		char timebuf[256];

Modified: team/russell/http_filetxfer/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/russell/http_filetxfer/main/manager.c?view=diff&rev=72669&r1=72668&r2=72669
==============================================================================
--- team/russell/http_filetxfer/main/manager.c (original)
+++ team/russell/http_filetxfer/main/manager.c Fri Jun 29 14:44:21 2007
@@ -3182,19 +3182,19 @@
 	return out;
 }
 
-static struct ast_str *manager_http_callback(struct sockaddr_in *requestor, const char *uri, struct ast_variable *params, int *status, char **title, int *contentlength)
-{
-	return generic_http_callback(FORMAT_HTML, requestor, uri, params, status, title, contentlength);
-}
-
-static struct ast_str *mxml_http_callback(struct sockaddr_in *requestor, const char *uri, struct ast_variable *params, int *status, char **title, int *contentlength)
-{
-	return generic_http_callback(FORMAT_XML, requestor, uri, params, status, title, contentlength);
-}
-
-static struct ast_str *rawman_http_callback(struct sockaddr_in *requestor, const char *uri, struct ast_variable *params, int *status, char **title, int *contentlength)
-{
-	return generic_http_callback(FORMAT_RAW, requestor, uri, params, status, title, contentlength);
+static struct ast_str *manager_http_callback(struct server_instance *ser, const char *uri, struct ast_variable *params, int *status, char **title, int *contentlength)
+{
+	return generic_http_callback(FORMAT_HTML, &ser->requestor, uri, params, status, title, contentlength);
+}
+
+static struct ast_str *mxml_http_callback(struct server_instance *ser, const char *uri, struct ast_variable *params, int *status, char **title, int *contentlength)
+{
+	return generic_http_callback(FORMAT_XML, &ser->requestor, uri, params, status, title, contentlength);
+}
+
+static struct ast_str *rawman_http_callback(struct server_instance *ser, const char *uri, struct ast_variable *params, int *status, char **title, int *contentlength)
+{
+	return generic_http_callback(FORMAT_RAW, &ser->requestor, uri, params, status, title, contentlength);
 }
 
 struct ast_http_uri rawmanuri = {




More information about the svn-commits mailing list