diff --git a/include/lighttpd/log.h b/include/lighttpd/log.h index 21abdc0..92a73c3 100644 --- a/include/lighttpd/log.h +++ b/include/lighttpd/log.h @@ -39,13 +39,13 @@ LI_API const char *remove_path(const char *path); log_split_lines_(srv, vr, LOG_LEVEL_BACKEND, LOG_FLAG_TIMESTAMP, txt, "(backend) %s.%d: "fmt, REMOVE_PATH(__FILE__), __LINE__, __VA_ARGS__) -#define VR_SEGFAULT(vr, fmt, ...) _SEGFAULT(vr->con->srv, vr, fmt, __VA_ARGS__) -#define VR_ERROR(vr, fmt, ...) _ERROR(vr->con->srv, vr, fmt, __VA_ARGS__) -#define VR_WARNING(vr, fmt, ...) _WARNING(vr->con->srv, vr, fmt, __VA_ARGS__) -#define VR_INFO(vr, fmt, ...) _INFO(vr->con->srv, vr, fmt, __VA_ARGS__) -#define VR_DEBUG(vr, fmt, ...) _DEBUG(vr->con->srv, vr, fmt, __VA_ARGS__) -#define VR_BACKEND(vr, fmt, ...) _BACKEND(vr->con->srv, vr, fmt, __VA_ARGS__) -#define VR_BACKEND_LINES(vr, txt, fmt, ...) _BACKEND_LINES(vr->con->srv, vr, txt, fmt, __VA_ARGS__) +#define VR_SEGFAULT(vr, fmt, ...) _SEGFAULT(vr->wrk->srv, vr, fmt, __VA_ARGS__) +#define VR_ERROR(vr, fmt, ...) _ERROR(vr->wrk->srv, vr, fmt, __VA_ARGS__) +#define VR_WARNING(vr, fmt, ...) _WARNING(vr->wrk->srv, vr, fmt, __VA_ARGS__) +#define VR_INFO(vr, fmt, ...) _INFO(vr->wrk->srv, vr, fmt, __VA_ARGS__) +#define VR_DEBUG(vr, fmt, ...) _DEBUG(vr->wrk->srv, vr, fmt, __VA_ARGS__) +#define VR_BACKEND(vr, fmt, ...) _BACKEND(vr->wrk->srv, vr, fmt, __VA_ARGS__) +#define VR_BACKEND_LINES(vr, txt, fmt, ...) _BACKEND_LINES(vr->wrk->srv, vr, txt, fmt, __VA_ARGS__) #define SEGFAULT(srv, fmt, ...) _SEGFAULT(srv, NULL, fmt, __VA_ARGS__) #define ERROR(srv, fmt, ...) _ERROR(srv, NULL, fmt, __VA_ARGS__) diff --git a/include/lighttpd/virtualrequest.h b/include/lighttpd/virtualrequest.h index 940bc3a..73067a7 100644 --- a/include/lighttpd/virtualrequest.h +++ b/include/lighttpd/virtualrequest.h @@ -57,6 +57,7 @@ struct vrequest_ref { struct vrequest { connection *con; + worker *wrk; vrequest_ref *ref; option_value *options; diff --git a/src/actions.c b/src/actions.c index 1a4766a..5ebd119 100644 --- a/src/actions.c +++ b/src/actions.c @@ -145,7 +145,7 @@ void action_stack_init(action_stack *as) { } void action_stack_reset(vrequest *vr, action_stack *as) { - server *srv = vr->con->srv; + server *srv = vr->wrk->srv; guint i; for (i = as->stack->len; i-- > 0; ) { action_stack_element_release(srv, vr, &g_array_index(as->stack, action_stack_element, i)); @@ -155,7 +155,7 @@ void action_stack_reset(vrequest *vr, action_stack *as) { } void action_stack_clear(vrequest *vr, action_stack *as) { - server *srv = vr->con->srv; + server *srv = vr->wrk->srv; guint i; for (i = as->stack->len; i-- > 0; ) { action_stack_element_release(srv, vr, &g_array_index(as->stack, action_stack_element, i)); @@ -189,7 +189,7 @@ handler_t action_execute(vrequest *vr) { action_stack_element *ase; handler_t res; gboolean condres; - server *srv = vr->con->srv; + server *srv = vr->wrk->srv; while (NULL != (ase = action_stack_top(as))) { if (as->backend_failed) { @@ -236,7 +236,7 @@ handler_t action_execute(vrequest *vr) { continue; } - vr->con->wrk->stats.actions_executed++; + vr->wrk->stats.actions_executed++; a = ase->act; switch (a->type) { diff --git a/src/chunk.c b/src/chunk.c index 209b646..ef5d615 100644 --- a/src/chunk.c +++ b/src/chunk.c @@ -52,7 +52,7 @@ handler_t chunkfile_open(vrequest *vr, chunkfile *cf) { } if (-1 == (cf->fd = open(cf->name->str, O_RDONLY))) { if (EMFILE == errno) { - server_out_of_fds(vr->con->srv); + server_out_of_fds(vr->wrk->srv); } VR_ERROR(vr, "Couldn't open file '%s': %s", GSTR_SAFE_STR(cf->name), g_strerror(errno)); return HANDLER_ERROR; @@ -361,7 +361,7 @@ void cqlimit_release(cqlimit *cql) { static void cqlimit_lock(cqlimit *cql) { cql->locked = TRUE; if (cql->io_watcher && cql->io_watcher->fd != -1) { - ev_io_rem_events(cql->vr->con->wrk->loop, cql->io_watcher, EV_READ); + ev_io_rem_events(cql->vr->wrk->loop, cql->io_watcher, EV_READ); } if (cql->notify) { cql->notify(cql->vr, cql->context, cql->locked); @@ -371,7 +371,7 @@ static void cqlimit_lock(cqlimit *cql) { static void cqlimit_unlock(cqlimit *cql) { cql->locked = FALSE; if (cql->io_watcher && cql->io_watcher->fd != -1) { - ev_io_add_events(cql->vr->con->wrk->loop, cql->io_watcher, EV_READ); + ev_io_add_events(cql->vr->wrk->loop, cql->io_watcher, EV_READ); } if (cql->notify) { cql->notify(cql->vr, cql->context, cql->locked); diff --git a/src/etag.c b/src/etag.c index 3e51bfe..3d4dbee 100644 --- a/src/etag.c +++ b/src/etag.c @@ -108,7 +108,7 @@ void etag_mutate(GString *mut, GString *etag) { void etag_set_header(vrequest *vr, struct stat *st, gboolean *cachable) { guint flags = CORE_OPTION(CORE_OPTION_ETAG_FLAGS).number; - GString *tmp_str = vr->con->wrk->tmp_str; + GString *tmp_str = vr->wrk->tmp_str; struct tm tm; tristate_t c_able = cachable ? TRI_MAYBE : TRI_FALSE; diff --git a/src/log.c b/src/log.c index 466cac4..e7acff8 100644 --- a/src/log.c +++ b/src/log.c @@ -49,7 +49,7 @@ gboolean log_write_(server *srv, vrequest *vr, log_level_t log_level, guint flag if (vr != NULL) { - if (!srv) srv = vr->con->srv; + if (!srv) srv = vr->wrk->srv; /* get log from connection */ log = g_array_index(CORE_OPTION(CORE_OPTION_LOG).list, log_t*, log_level); if (log == NULL) @@ -102,7 +102,7 @@ gboolean log_write_(server *srv, vrequest *vr, log_level_t log_level, guint flag /* if we have a worker context, we can use its timestamp to save us a call to time() */ if (vr != NULL) - cur_ts = (time_t)CUR_TS(vr->con->wrk); + cur_ts = (time_t)CUR_TS(vr->wrk); else cur_ts = time(NULL); diff --git a/src/modules/mod_cache_disk_etag.c b/src/modules/mod_cache_disk_etag.c index 9c53cfb..6103ca6 100644 --- a/src/modules/mod_cache_disk_etag.c +++ b/src/modules/mod_cache_disk_etag.c @@ -233,7 +233,7 @@ static handler_t cache_etag_handle(vrequest *vr, gpointer param, gpointer *conte GList *etag_entry; http_header *etag; struct stat st; - GString *tmp_str = vr->con->wrk->tmp_str; + GString *tmp_str = vr->wrk->tmp_str; if (!cfile) { if (vr->request.http_method != HTTP_METHOD_GET) return HANDLER_GO_ON; @@ -265,7 +265,7 @@ static handler_t cache_etag_handle(vrequest *vr, gpointer param, gpointer *conte } if (-1 == (cfile->hit_fd = open(cfile->filename->str, O_RDONLY))) { if (EMFILE == errno) { - server_out_of_fds(vr->con->srv); + server_out_of_fds(vr->wrk->srv); } VR_ERROR(vr, "Couldn't open cache file '%s': %s", cfile->filename->str, g_strerror(errno)); return HANDLER_GO_ON; /* no caching */ diff --git a/src/modules/mod_debug.c b/src/modules/mod_debug.c index 71d4110..750f77d 100644 --- a/src/modules/mod_debug.c +++ b/src/modules/mod_debug.c @@ -204,8 +204,8 @@ static void debug_collect_cb(gpointer cbdata, gpointer fdata, GPtrArray *result, GString *duration = g_string_sized_new(15); g_string_append_printf(html, "
now: %f
io timeout watcher active/repeat: %s/%f
Client | Duration | |
---|---|---|
%s | %s | debug |