diff options
author | Valentin Bartenev <vbart@nginx.com> | 2018-04-11 18:23:33 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2018-04-11 18:23:33 +0300 |
commit | 204c39472166440f54435edcef8d286f429e0aae (patch) | |
tree | 25fb74d5a547bc96c72d1f8a70d434d3cbdedc75 /src/nxt_router.h | |
parent | c7e575d5c61c2b301207c751ae73186d7568857e (diff) | |
download | unit-204c39472166440f54435edcef8d286f429e0aae.tar.gz unit-204c39472166440f54435edcef8d286f429e0aae.tar.bz2 |
Initial access log support.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_router.h | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/nxt_router.h b/src/nxt_router.h index ffcad3b9..da3dc26f 100644 --- a/src/nxt_router.h +++ b/src/nxt_router.h @@ -12,24 +12,31 @@ #include <nxt_runtime.h> #include <nxt_main_process.h> -typedef struct nxt_http_request_s nxt_http_request_t; +typedef struct nxt_http_request_s nxt_http_request_t; #include <nxt_application.h> +typedef struct nxt_router_access_log_s nxt_router_access_log_t; + + typedef struct { - nxt_thread_spinlock_t lock; - nxt_queue_t engines; + nxt_thread_spinlock_t lock; + nxt_queue_t engines; - nxt_queue_t sockets; /* of nxt_socket_conf_t */ - nxt_queue_t apps; /* of nxt_app_t */ + nxt_queue_t sockets; /* of nxt_socket_conf_t */ + nxt_queue_t apps; /* of nxt_app_t */ + + nxt_router_access_log_t *access_log; } nxt_router_t; typedef struct { - uint32_t count; - uint32_t threads; - nxt_router_t *router; - nxt_mp_t *mem_pool; + uint32_t count; + uint32_t threads; + nxt_router_t *router; + nxt_mp_t *mem_pool; + + nxt_router_access_log_t *access_log; } nxt_router_conf_t; @@ -157,6 +164,15 @@ typedef struct { } nxt_socket_conf_joint_t; +struct nxt_router_access_log_s { + void (*handler)(nxt_task_t *task, nxt_http_request_t *r, + nxt_router_access_log_t *access_log); + nxt_fd_t fd; + nxt_str_t path; + uint32_t count; +}; + + void nxt_router_new_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); void nxt_router_conf_data_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); void nxt_router_remove_pid_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg); |