2016-03-19 15:14:35 +00:00
|
|
|
#include "first.h"
|
|
|
|
|
2021-08-02 01:26:53 +00:00
|
|
|
#include "algo_splaytree.h"
|
2005-09-25 17:11:52 +00:00
|
|
|
#include "log.h"
|
|
|
|
#include "buffer.h"
|
2021-08-02 01:26:53 +00:00
|
|
|
#include "request.h"
|
2018-09-09 05:50:33 +00:00
|
|
|
#include "http_header.h"
|
2005-09-25 17:11:52 +00:00
|
|
|
|
|
|
|
#include "plugin.h"
|
|
|
|
|
2009-10-11 14:31:42 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2005-09-25 17:11:52 +00:00
|
|
|
/**
|
|
|
|
* this is a uploadprogress for a lighttpd plugin
|
2006-10-04 13:26:23 +00:00
|
|
|
*
|
2005-09-25 17:11:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct {
|
2021-08-02 01:26:53 +00:00
|
|
|
buffer r_id;
|
|
|
|
request_st *r;
|
|
|
|
int ndx;
|
2020-01-13 02:51:12 +00:00
|
|
|
} request_map_entry;
|
2005-09-25 17:11:52 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2019-10-27 03:04:40 +00:00
|
|
|
const buffer *progress_url;
|
2005-09-25 17:11:52 +00:00
|
|
|
} plugin_config;
|
|
|
|
|
|
|
|
typedef struct {
|
2019-10-27 03:04:40 +00:00
|
|
|
PLUGIN_DATA;
|
|
|
|
plugin_config defaults;
|
|
|
|
plugin_config conf;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2021-08-02 01:26:53 +00:00
|
|
|
splay_tree *request_map;
|
2005-09-25 17:11:52 +00:00
|
|
|
} plugin_data;
|
|
|
|
|
|
|
|
/**
|
2006-10-04 13:26:23 +00:00
|
|
|
*
|
2020-01-13 02:51:12 +00:00
|
|
|
* request maps
|
2006-10-04 13:26:23 +00:00
|
|
|
*
|
2005-09-25 17:11:52 +00:00
|
|
|
*/
|
|
|
|
|
2021-08-02 01:26:53 +00:00
|
|
|
static request_map_entry *
|
|
|
|
request_map_entry_init (request_st * const r, const char *r_id, size_t idlen)
|
|
|
|
{
|
|
|
|
request_map_entry * const rme = calloc(1, sizeof(request_map_entry));
|
|
|
|
force_assert(rme);
|
|
|
|
rme->r = r;
|
|
|
|
rme->ndx = splaytree_djbhash(r_id, idlen);
|
|
|
|
buffer_copy_string_len(&rme->r_id, r_id, idlen);
|
|
|
|
return rme;
|
2005-09-25 17:11:52 +00:00
|
|
|
}
|
|
|
|
|
2021-08-02 01:26:53 +00:00
|
|
|
static void
|
|
|
|
request_map_entry_free (request_map_entry *rme)
|
|
|
|
{
|
|
|
|
free(rme->r_id.ptr);
|
|
|
|
free(rme);
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2021-08-02 01:26:53 +00:00
|
|
|
static void
|
|
|
|
request_map_remove (plugin_data * const p, request_map_entry * const rme)
|
|
|
|
{
|
|
|
|
splay_tree ** const sptree = &p->request_map;
|
|
|
|
*sptree = splaytree_splay(*sptree, rme->ndx);
|
|
|
|
if (NULL != *sptree && (*sptree)->key == rme->ndx) {
|
|
|
|
request_map_entry_free((*sptree)->data);
|
|
|
|
*sptree = splaytree_delete(*sptree, (*sptree)->key);
|
|
|
|
}
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2021-08-02 01:26:53 +00:00
|
|
|
static request_map_entry *
|
|
|
|
request_map_insert (plugin_data * const p, request_map_entry * const rme)
|
|
|
|
{
|
|
|
|
splay_tree ** const sptree = &p->request_map;
|
|
|
|
*sptree = splaytree_splay(*sptree, rme->ndx);
|
|
|
|
if (NULL == *sptree || (*sptree)->key != rme->ndx) {
|
|
|
|
*sptree = splaytree_insert(*sptree, rme->ndx, rme);
|
|
|
|
return rme;
|
|
|
|
}
|
|
|
|
else { /* collision (not expected); leave old entry and forget new */
|
|
|
|
/*(old entry is referenced elsewhere, so new entry is freed here)*/
|
|
|
|
request_map_entry_free(rme);
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-09-25 17:11:52 +00:00
|
|
|
}
|
|
|
|
|
2021-03-15 09:41:50 +00:00
|
|
|
__attribute_pure__
|
2021-08-02 01:26:53 +00:00
|
|
|
static request_st *
|
|
|
|
request_map_get_request (plugin_data * const p, const char * const r_id, const size_t idlen)
|
|
|
|
{
|
|
|
|
splay_tree ** const sptree = &p->request_map;
|
|
|
|
int ndx = splaytree_djbhash(r_id, idlen);
|
|
|
|
*sptree = splaytree_splay(*sptree, ndx);
|
|
|
|
if (NULL != *sptree && (*sptree)->key == ndx) {
|
|
|
|
request_map_entry * const rme = (*sptree)->data;
|
|
|
|
if (buffer_eq_slen(&rme->r_id, r_id, idlen))
|
|
|
|
return rme->r;
|
|
|
|
}
|
|
|
|
return NULL;
|
2005-09-25 17:11:52 +00:00
|
|
|
}
|
|
|
|
|
2021-08-02 01:26:53 +00:00
|
|
|
static void
|
|
|
|
request_map_free (plugin_data * const p)
|
|
|
|
{
|
|
|
|
splay_tree *sptree = p->request_map;
|
|
|
|
p->request_map = NULL;
|
|
|
|
while (sptree) {
|
|
|
|
request_map_entry_free(sptree->data);
|
|
|
|
sptree = splaytree_delete(sptree, sptree->key);
|
|
|
|
}
|
2005-09-25 17:11:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
INIT_FUNC(mod_uploadprogress_init) {
|
2019-10-27 03:04:40 +00:00
|
|
|
return calloc(1, sizeof(plugin_data));
|
2005-09-25 17:11:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
FREE_FUNC(mod_uploadprogress_free) {
|
2021-08-02 01:26:53 +00:00
|
|
|
request_map_free((plugin_data *)p_d);
|
2005-09-25 17:11:52 +00:00
|
|
|
}
|
|
|
|
|
2019-10-27 03:04:40 +00:00
|
|
|
static void mod_uploadprogress_merge_config_cpv(plugin_config * const pconf, const config_plugin_value_t * const cpv) {
|
|
|
|
switch (cpv->k_id) { /* index into static config_plugin_keys_t cpk[] */
|
|
|
|
case 0: /* upload-progress.progress-url */
|
|
|
|
pconf->progress_url = cpv->v.b;
|
|
|
|
break;
|
|
|
|
default:/* should not happen */
|
|
|
|
return;
|
|
|
|
}
|
2005-09-25 17:11:52 +00:00
|
|
|
}
|
|
|
|
|
2019-10-27 03:04:40 +00:00
|
|
|
static void mod_uploadprogress_merge_config(plugin_config * const pconf, const config_plugin_value_t *cpv) {
|
|
|
|
do {
|
|
|
|
mod_uploadprogress_merge_config_cpv(pconf, cpv);
|
|
|
|
} while ((++cpv)->k_id != -1);
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2020-01-13 02:51:12 +00:00
|
|
|
static void mod_uploadprogress_patch_config(request_st * const r, plugin_data * const p) {
|
2020-01-11 16:07:43 +00:00
|
|
|
p->conf = p->defaults; /* copy small struct instead of memcpy() */
|
|
|
|
/*memcpy(&p->conf, &p->defaults, sizeof(plugin_config));*/
|
2019-10-27 03:04:40 +00:00
|
|
|
for (int i = 1, used = p->nconfig; i < used; ++i) {
|
2020-01-13 02:51:12 +00:00
|
|
|
if (config_check_cond(r, (uint32_t)p->cvlist[i].k_id))
|
2019-10-27 03:04:40 +00:00
|
|
|
mod_uploadprogress_merge_config(&p->conf,
|
|
|
|
p->cvlist + p->cvlist[i].v.u2[0]);
|
|
|
|
}
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2019-10-27 03:04:40 +00:00
|
|
|
SETDEFAULTS_FUNC(mod_uploadprogress_set_defaults) {
|
|
|
|
static const config_plugin_keys_t cpk[] = {
|
|
|
|
{ CONST_STR_LEN("upload-progress.progress-url"),
|
|
|
|
T_CONFIG_STRING,
|
|
|
|
T_CONFIG_SCOPE_CONNECTION }
|
|
|
|
,{ NULL, 0,
|
|
|
|
T_CONFIG_UNSET,
|
|
|
|
T_CONFIG_SCOPE_UNSET }
|
|
|
|
};
|
|
|
|
|
|
|
|
plugin_data * const p = p_d;
|
|
|
|
if (!config_plugin_values_init(srv, p, cpk, "mod_uploadprogress"))
|
|
|
|
return HANDLER_ERROR;
|
|
|
|
|
[multiple] reduce redundant NULL buffer checks
This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot code paths.
Most (buffer *) used by lighttpd are not NULL, especially since buffers
were inlined into numerous larger structs such as request_st and chunk.
In the small number of instances where that is not the case, a NULL
check is often performed earlier in a function where that buffer is
later used with a buffer_* func. In the handful of cases that remained,
a NULL check was added, e.g. with r->http_host and r->conf.server_tag.
- check for empty strings at config time and set value to NULL if blank
string will be ignored at runtime; at runtime, simple pointer check
for NULL can be used to check for a value that has been set and is not
blank ("")
- use buffer_is_blank() instead of buffer_string_is_empty(),
and use buffer_is_unset() instead of buffer_is_empty(),
where buffer is known not to be NULL so that NULL check can be skipped
- use buffer_clen() instead of buffer_string_length() when buffer is
known not to be NULL (to avoid NULL check at runtime)
- use buffer_truncate() instead of buffer_string_set_length() to
truncate string, and use buffer_extend() to extend
Examples where buffer known not to be NULL:
- cpv->v.b from config_plugin_values_init is not NULL if T_CONFIG_BOOL
(though we might set it to NULL if buffer_is_blank(cpv->v.b))
- address of buffer is arg (&foo)
(compiler optimizer detects this in most, but not all, cases)
- buffer is checked for NULL earlier in func
- buffer is accessed in same scope without a NULL check (e.g. b->ptr)
internal behavior change:
callers must not pass a NULL buffer to some funcs.
- buffer_init_buffer() requires non-null args
- buffer_copy_buffer() requires non-null args
- buffer_append_string_buffer() requires non-null args
- buffer_string_space() requires non-null arg
2021-06-09 02:57:36 +00:00
|
|
|
/* process and validate config directives
|
|
|
|
* (init i to 0 if global context; to 1 to skip empty global context) */
|
|
|
|
for (int i = !p->cvlist[0].v.u2[1]; i < p->nconfig; ++i) {
|
|
|
|
config_plugin_value_t *cpv = p->cvlist + p->cvlist[i].v.u2[0];
|
|
|
|
for (; -1 != cpv->k_id; ++cpv) {
|
|
|
|
switch (cpv->k_id) {
|
|
|
|
case 0: /* upload-progress.progress-url */
|
|
|
|
if (buffer_is_blank(cpv->v.b))
|
|
|
|
cpv->v.b = NULL;
|
|
|
|
break;
|
|
|
|
default:/* should not happen */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-27 03:04:40 +00:00
|
|
|
/* initialize p->defaults from global config context */
|
|
|
|
if (p->nconfig > 0 && p->cvlist->v.u2[1]) {
|
|
|
|
const config_plugin_value_t *cpv = p->cvlist + p->cvlist->v.u2[0];
|
|
|
|
if (-1 != cpv->k_id)
|
|
|
|
mod_uploadprogress_merge_config(&p->defaults, cpv);
|
|
|
|
}
|
|
|
|
|
|
|
|
return HANDLER_GO_ON;
|
2005-09-25 17:11:52 +00:00
|
|
|
}
|
|
|
|
|
2021-08-02 01:26:53 +00:00
|
|
|
#define REQID_LEN 32
|
|
|
|
|
|
|
|
static const char * mod_uploadprogress_get_reqid (request_st * const r) {
|
|
|
|
const char *idstr;
|
|
|
|
uint32_t len;
|
|
|
|
int pathinfo = 0;
|
|
|
|
const buffer *h = http_header_request_get(r, HTTP_HEADER_OTHER,
|
|
|
|
CONST_STR_LEN("X-Progress-ID"));
|
|
|
|
if (NULL != h)
|
|
|
|
idstr = h->ptr;
|
|
|
|
else if (!buffer_is_blank(&r->uri.query)
|
|
|
|
&& (idstr = strstr(r->uri.query.ptr, "X-Progress-ID=")))
|
|
|
|
idstr += sizeof("X-Progress-ID=")-1;
|
|
|
|
else { /*(path-info is not known at this point in request)*/
|
|
|
|
idstr = r->uri.path.ptr;
|
|
|
|
len = buffer_clen(&r->uri.path);
|
|
|
|
if (len > REQID_LEN && idstr[len-REQID_LEN-1] == '/') {
|
|
|
|
pathinfo = 1;
|
|
|
|
idstr += len - REQID_LEN;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* request must contain ID of REQID_LEN bytes */
|
|
|
|
for (len = 0; light_isxdigit(idstr[len]); ++len) ;
|
|
|
|
if (len != REQID_LEN) {
|
|
|
|
if (!pathinfo) { /*(reduce false positive noise in error log)*/
|
|
|
|
log_error(r->conf.errh, __FILE__, __LINE__,
|
|
|
|
"invalid progress-id; non-xdigit or len != %d: %s",
|
|
|
|
REQID_LEN, idstr);
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return idstr;
|
|
|
|
}
|
|
|
|
|
2005-09-25 17:11:52 +00:00
|
|
|
/**
|
2006-10-04 13:26:23 +00:00
|
|
|
*
|
2005-09-25 17:11:52 +00:00
|
|
|
* the idea:
|
2006-10-04 13:26:23 +00:00
|
|
|
*
|
|
|
|
* for the first request we check if it is a post-request
|
|
|
|
*
|
2005-09-25 17:11:52 +00:00
|
|
|
* if no, move out, don't care about them
|
2006-10-04 13:26:23 +00:00
|
|
|
*
|
|
|
|
* if yes, take the connection structure and register it locally
|
2005-09-25 17:11:52 +00:00
|
|
|
* in the progress-struct together with an session-id (md5 ... )
|
2006-10-04 13:26:23 +00:00
|
|
|
*
|
2005-09-25 17:11:52 +00:00
|
|
|
* if the connections closes, cleanup the entry in the progress-struct
|
2006-10-04 13:26:23 +00:00
|
|
|
*
|
2005-09-25 17:11:52 +00:00
|
|
|
* a second request can now get the info about the size of the upload,
|
|
|
|
* the received bytes
|
2006-10-04 13:26:23 +00:00
|
|
|
*
|
2005-09-25 17:11:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
URIHANDLER_FUNC(mod_uploadprogress_uri_handler) {
|
|
|
|
plugin_data *p = p_d;
|
|
|
|
|
2020-01-13 02:51:12 +00:00
|
|
|
switch(r->http_method) {
|
2016-07-07 17:49:56 +00:00
|
|
|
case HTTP_METHOD_GET:
|
|
|
|
case HTTP_METHOD_POST: break;
|
|
|
|
default: return HANDLER_GO_ON;
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2020-01-13 02:51:12 +00:00
|
|
|
mod_uploadprogress_patch_config(r, p);
|
[multiple] reduce redundant NULL buffer checks
This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot code paths.
Most (buffer *) used by lighttpd are not NULL, especially since buffers
were inlined into numerous larger structs such as request_st and chunk.
In the small number of instances where that is not the case, a NULL
check is often performed earlier in a function where that buffer is
later used with a buffer_* func. In the handful of cases that remained,
a NULL check was added, e.g. with r->http_host and r->conf.server_tag.
- check for empty strings at config time and set value to NULL if blank
string will be ignored at runtime; at runtime, simple pointer check
for NULL can be used to check for a value that has been set and is not
blank ("")
- use buffer_is_blank() instead of buffer_string_is_empty(),
and use buffer_is_unset() instead of buffer_is_empty(),
where buffer is known not to be NULL so that NULL check can be skipped
- use buffer_clen() instead of buffer_string_length() when buffer is
known not to be NULL (to avoid NULL check at runtime)
- use buffer_truncate() instead of buffer_string_set_length() to
truncate string, and use buffer_extend() to extend
Examples where buffer known not to be NULL:
- cpv->v.b from config_plugin_values_init is not NULL if T_CONFIG_BOOL
(though we might set it to NULL if buffer_is_blank(cpv->v.b))
- address of buffer is arg (&foo)
(compiler optimizer detects this in most, but not all, cases)
- buffer is checked for NULL earlier in func
- buffer is accessed in same scope without a NULL check (e.g. b->ptr)
internal behavior change:
callers must not pass a NULL buffer to some funcs.
- buffer_init_buffer() requires non-null args
- buffer_copy_buffer() requires non-null args
- buffer_append_string_buffer() requires non-null args
- buffer_string_space() requires non-null arg
2021-06-09 02:57:36 +00:00
|
|
|
if (!p->conf.progress_url) return HANDLER_GO_ON;
|
2016-07-07 17:49:56 +00:00
|
|
|
|
2021-08-02 01:26:53 +00:00
|
|
|
if (r->http_method == HTTP_METHOD_GET
|
|
|
|
&& !buffer_is_equal(&r->uri.path, p->conf.progress_url))
|
2017-05-05 14:31:07 +00:00
|
|
|
return HANDLER_GO_ON;
|
2016-07-07 17:49:56 +00:00
|
|
|
|
2021-08-02 01:26:53 +00:00
|
|
|
const char * const idstr = mod_uploadprogress_get_reqid(r);
|
|
|
|
if (NULL == idstr) return HANDLER_GO_ON;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2021-08-02 01:26:53 +00:00
|
|
|
if (r->http_method == HTTP_METHOD_POST) {
|
|
|
|
r->plugin_ctx[p->id] =
|
|
|
|
request_map_insert(p, request_map_entry_init(r, idstr, REQID_LEN));
|
2005-09-25 17:11:52 +00:00
|
|
|
return HANDLER_GO_ON;
|
2021-08-02 01:26:53 +00:00
|
|
|
} /* else r->http_method == HTTP_METHOD_GET */
|
|
|
|
|
2005-09-26 08:55:07 +00:00
|
|
|
|
2020-01-13 02:51:12 +00:00
|
|
|
r->resp_body_started = 1;
|
|
|
|
r->resp_body_finished = 1;
|
2005-09-26 08:55:07 +00:00
|
|
|
|
2020-01-13 02:51:12 +00:00
|
|
|
r->http_status = 200;
|
|
|
|
r->handler_module = NULL;
|
2005-09-26 08:55:07 +00:00
|
|
|
|
2005-09-25 17:11:52 +00:00
|
|
|
/* get the connection */
|
2021-08-02 01:26:53 +00:00
|
|
|
request_st * const post_r = request_map_get_request(p,idstr,REQID_LEN);
|
|
|
|
if (NULL == post_r) {
|
|
|
|
log_error(r->conf.errh, __FILE__, __LINE__, "ID not known: %.*s", REQID_LEN, idstr);
|
|
|
|
/* XXX: why is this not an XML response, too?
|
|
|
|
* (At least Content-Type is not set to text/xml) */
|
2020-09-29 20:50:39 +00:00
|
|
|
chunkqueue_append_mem(&r->write_queue, CONST_STR_LEN("not in progress"));
|
2005-09-25 17:11:52 +00:00
|
|
|
return HANDLER_FINISHED;
|
|
|
|
}
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2020-01-13 02:51:12 +00:00
|
|
|
http_header_response_set(r, HTTP_HEADER_CONTENT_TYPE, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/xml"));
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-09-25 17:11:52 +00:00
|
|
|
/* just an attempt the force the IE/proxies to NOT cache the request ... doesn't help :( */
|
2020-09-13 02:23:16 +00:00
|
|
|
http_header_response_set(r, HTTP_HEADER_PRAGMA, CONST_STR_LEN("Pragma"), CONST_STR_LEN("no-cache"));
|
|
|
|
http_header_response_set(r, HTTP_HEADER_EXPIRES, CONST_STR_LEN("Expires"), CONST_STR_LEN("Thu, 19 Nov 1981 08:52:00 GMT"));
|
2020-01-13 02:51:12 +00:00
|
|
|
http_header_response_set(r, HTTP_HEADER_CACHE_CONTROL, CONST_STR_LEN("Cache-Control"), CONST_STR_LEN("no-store, no-cache, must-revalidate, post-check=0, pre-check=0"));
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-09-25 17:11:52 +00:00
|
|
|
/* prepare XML */
|
2021-08-02 01:26:53 +00:00
|
|
|
buffer * const b = chunkqueue_append_buffer_open(&r->write_queue);
|
2008-07-30 19:38:32 +00:00
|
|
|
buffer_copy_string_len(b, CONST_STR_LEN(
|
|
|
|
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>"
|
|
|
|
"<upload>"
|
|
|
|
"<size>"));
|
2020-01-13 02:51:12 +00:00
|
|
|
buffer_append_int(b, post_r->reqbody_length);
|
2008-07-30 19:38:32 +00:00
|
|
|
buffer_append_string_len(b, CONST_STR_LEN(
|
|
|
|
"</size>"
|
|
|
|
"<received>"));
|
2020-09-29 20:50:39 +00:00
|
|
|
buffer_append_int(b, post_r->reqbody_queue.bytes_in);
|
2008-07-30 19:38:32 +00:00
|
|
|
buffer_append_string_len(b, CONST_STR_LEN(
|
|
|
|
"</received>"
|
|
|
|
"</upload>"));
|
2021-08-02 01:26:53 +00:00
|
|
|
chunkqueue_append_buffer_commit(&r->write_queue);
|
2005-09-25 17:11:52 +00:00
|
|
|
return HANDLER_FINISHED;
|
|
|
|
}
|
|
|
|
|
|
|
|
REQUESTDONE_FUNC(mod_uploadprogress_request_done) {
|
|
|
|
plugin_data *p = p_d;
|
2021-08-02 01:26:53 +00:00
|
|
|
request_map_entry * const rme = r->plugin_ctx[p->id];
|
|
|
|
if (rme) {
|
|
|
|
r->plugin_ctx[p->id] = NULL;
|
|
|
|
request_map_remove(p, rme);
|
2005-09-25 17:11:52 +00:00
|
|
|
}
|
|
|
|
return HANDLER_GO_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-03-07 21:05:37 +00:00
|
|
|
int mod_uploadprogress_plugin_init(plugin *p);
|
2005-09-25 17:11:52 +00:00
|
|
|
int mod_uploadprogress_plugin_init(plugin *p) {
|
|
|
|
p->version = LIGHTTPD_VERSION_ID;
|
2019-10-19 04:30:54 +00:00
|
|
|
p->name = "uploadprogress";
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-09-25 17:11:52 +00:00
|
|
|
p->init = mod_uploadprogress_init;
|
|
|
|
p->handle_uri_clean = mod_uploadprogress_uri_handler;
|
2020-07-25 12:23:58 +00:00
|
|
|
p->handle_request_reset = mod_uploadprogress_request_done;
|
2005-09-25 17:11:52 +00:00
|
|
|
p->set_defaults = mod_uploadprogress_set_defaults;
|
|
|
|
p->cleanup = mod_uploadprogress_free;
|
2006-10-04 13:26:23 +00:00
|
|
|
|
2005-09-25 17:11:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|