Merge changes from team/russell/http_filetxfer

Handle transferring large files from the built-in http server.  Previously, the
code attempted to malloc a block as large as the file itself.  Now it uses the
sendfile() system call so that the file isn't copied into userspace at all if
it is available.  Otherwise, it just uses a read/write of small chunks at a time.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-06-29 20:35:09 +00:00
parent 3caa225108
commit 408dbc4304
6 changed files with 119 additions and 29 deletions

View File

@@ -394,6 +394,9 @@
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
/* Define if your system has the sendfile syscall. */
#undef HAVE_SENDFILE
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV

View File

@@ -147,7 +147,7 @@ int ssl_setup(struct tls_config *cfg);
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 {