[asterisk-commits] tilghman: branch group/manager_http_auth r188477 - /team/group/manager_http_a...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Apr 14 19:04:39 CDT 2009
Author: tilghman
Date: Tue Apr 14 19:04:36 2009
New Revision: 188477
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=188477
Log:
Holy Engrish, Batman!
Modified:
team/group/manager_http_auth/include/asterisk/http.h
Modified: team/group/manager_http_auth/include/asterisk/http.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/manager_http_auth/include/asterisk/http.h?view=diff&rev=188477&r1=188476&r2=188477
==============================================================================
--- team/group/manager_http_auth/include/asterisk/http.h (original)
+++ team/group/manager_http_auth/include/asterisk/http.h Tue Apr 14 19:04:36 2009
@@ -63,7 +63,7 @@
struct ast_http_uri;
-/*! \brief HTTP Callbacks take the socket
+/*! \brief HTTP Callbacks
*
* \note The callback function receives server instance, uri, http method,
* get method (if present in URI), and http headers as arguments and should
@@ -74,13 +74,13 @@
* function to reflect the status of the request (200 or 304, for example).
* Content length is calculated by ast_http_send() automatically.
*
- * Static content is indicated in the argument passed to the ast_http_send()
- * function.
+ * Static content may be indicated to the ast_http_send() function, to indicate
+ * that it may be cached.
*
* \verbatim
- * All additional http response headers must be sent as a separate ast_str
- * object, and must not be part of the response content! No additional lines
- * with \r\n are required.
+ * The return value may include additional headers at the front and MUST
+ * include a blank line with \r\n to provide separation between user headers
+ * and content (even if no content is specified)
* \endverbatim
*
* For an error response, the ast_http_error() function may be used.
@@ -104,7 +104,7 @@
const char *key;
};
-/* Get cookie from Request headers */
+/*! \brief Get cookie from Request headers */
struct ast_variable *ast_http_get_cookies(struct ast_variable *headers);
/*! \brief Register a URI handler */
@@ -126,29 +126,26 @@
uint32_t manid_from_vars(struct ast_variable *headers);
/*! \brief Generic function for sending http/1.1 responce.
- \note Function make http responce header from status_code,
- status_header and http_header.
-
- Extra http header MUST BE only present in http_header argument.
- Argument "out" contain only content of response (no headers!).
-
- Http content can be constructed from mallocated argument "out", if
- it is not NULL.
- And, if fd is not null, from opened (for reading) file.
-
- This function calculate content-lenght http header itself.
-
- if http_header or out argument have not NULL value, this function
- free memory, mallocated by caller and close http socket before exit.
-
- This function don't close file, identifide in fd variable.
+ * \note Function determines the HTTP response header from status_code,
+ * status_header, and http_header.
+ *
+ * Extra HTTP headers MUST be present only in the http_header argument. The
+ * argument "out" should contain only content of the response (no headers!).
+ *
+ * HTTP content can be constructed from the argument "out", if it is not NULL;
+ * otherwise, the function will read content from FD.
+ *
+ * This function calculates the content-length http header itself.
+ *
+ * Both the http_header and out arguments will be freed by this function;
+ * however, if FD is open, it will remain open.
*/
void ast_http_send(struct ast_tcptls_session_instance *ser, enum ast_http_method method, int status_code, const char *status_title, struct ast_str *http_header, struct ast_str *out, const int fd, unsigned int static_content);
-/* \brief Send http "401 Unauthorized" responce and close socket*/
+/*!\brief Send http "401 Unauthorized" response and close socket */
void ast_http_auth(struct ast_tcptls_session_instance *ser, const char *realm, const unsigned long nonce, const unsigned long opaque, int stale, const char *text);
-/* \brief Send HTTP error message and close socket */
+/*!\brief Send HTTP error message and close socket */
void ast_http_error(struct ast_tcptls_session_instance *ser, int status, const char *title, const char *text);
/*!
@@ -160,8 +157,9 @@
void ast_http_prefix(char *buf, int len);
-/* \brief get post variables from client Request Entity-Body, if content type
- is application/x-www-form-urlencoded. */
+/*!\brief get post variables from client Request Entity-Body, if content type
+ * is application/x-www-form-urlencoded.
+ */
struct ast_variable *get_post_vars(struct ast_tcptls_session_instance *ser, struct ast_variable *headers);
More information about the asterisk-commits
mailing list