summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2024-08-16 00:09:22 +0800
committerZhidao HONG <z.hong@f5.com>2024-08-20 09:17:24 +0800
commit57f939569d3c3db11d8bbc7dd0b45693cbe3344e (patch)
tree09a58bd512a77ad3714fc71ee0a2271e9d2acc66 /src
parent82e168fe01306cf03f8eaba284f31f7285347424 (diff)
downloadunit-57f939569d3c3db11d8bbc7dd0b45693cbe3344e.tar.gz
unit-57f939569d3c3db11d8bbc7dd0b45693cbe3344e.tar.bz2
http: Get rid of nxt_http_request_access_log()
Diffstat (limited to 'src')
-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)