summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_request.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nxt_http_request.c')
-rw-r--r--src/nxt_http_request.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index a65163d0..a7e9ff69 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -24,8 +24,6 @@ static void nxt_http_request_proto_info(nxt_task_t *task,
static void nxt_http_request_mem_buf_completion(nxt_task_t *task, void *obj,
void *data);
static void nxt_http_request_done(nxt_task_t *task, void *obj, void *data);
-static nxt_int_t nxt_http_request_access_log(nxt_task_t *task,
- nxt_http_request_t *r, nxt_router_conf_t *rtcf);
static u_char *nxt_http_date_cache_handler(u_char *buf, nxt_realtime_t *now,
struct tm *tm, size_t size, const char *format);
@@ -861,12 +859,12 @@ nxt_http_request_error_handler(nxt_task_t *task, void *obj, void *data)
void
nxt_http_request_close_handler(nxt_task_t *task, void *obj, void *data)
{
- nxt_int_t ret;
nxt_http_proto_t proto;
nxt_router_conf_t *rtcf;
nxt_http_request_t *r;
nxt_http_protocol_t protocol;
nxt_socket_conf_joint_t *conf;
+ nxt_router_access_log_t *access_log;
r = obj;
proto.any = data;
@@ -878,8 +876,10 @@ nxt_http_request_close_handler(nxt_task_t *task, void *obj, void *data)
r->logged = 1;
if (rtcf->access_log != NULL) {
- ret = nxt_http_request_access_log(task, r, rtcf);
- if (ret == NXT_OK) {
+ access_log = rtcf->access_log;
+
+ if (nxt_http_cond_value(task, r, &rtcf->log_cond)) {
+ access_log->handler(task, r, access_log, rtcf->log_format);
return;
}
}
@@ -911,23 +911,6 @@ nxt_http_request_close_handler(nxt_task_t *task, void *obj, void *data)
}
-static nxt_int_t
-nxt_http_request_access_log(nxt_task_t *task, nxt_http_request_t *r,
- nxt_router_conf_t *rtcf)
-{
- nxt_router_access_log_t *access_log;
-
- access_log = rtcf->access_log;
-
- if (nxt_http_cond_value(task, r, &rtcf->log_cond)) {
- access_log->handler(task, r, access_log, rtcf->log_format);
- return NXT_OK;
- }
-
- return NXT_DECLINED;
-}
-
-
static u_char *
nxt_http_date_cache_handler(u_char *buf, nxt_realtime_t *now, struct tm *tm,
size_t size, const char *format)