annotate src/core/ngx_syslog.h @ 9240:f3df785649ae

Request body: limited chunk extensions and trailer headers. Previously, arbitrary amounts of chunk extensions and trailer headers were accepted and skipped. Despite being under limit_conn / limit_req limits (if configured), this can be a DoS vector, so it is now limited by the client_max_body_size limit. Reported by Bartek Nowotarski.
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 30 Mar 2024 05:09:35 +0300
parents 1c9264603adc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5702
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
1
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
2 /*
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
3 * Copyright (C) Nginx, Inc.
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
4 */
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
5
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
6
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
7 #ifndef _NGX_SYSLOG_H_INCLUDED_
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
8 #define _NGX_SYSLOG_H_INCLUDED_
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
9
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
10
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
11 typedef struct {
8149
29adacffdefa Syslog: removed usage of ngx_cycle->log and ngx_cycle->hostname.
Maxim Dounin <mdounin@mdounin.ru>
parents: 7277
diff changeset
12 ngx_uint_t facility;
29adacffdefa Syslog: removed usage of ngx_cycle->log and ngx_cycle->hostname.
Maxim Dounin <mdounin@mdounin.ru>
parents: 7277
diff changeset
13 ngx_uint_t severity;
29adacffdefa Syslog: removed usage of ngx_cycle->log and ngx_cycle->hostname.
Maxim Dounin <mdounin@mdounin.ru>
parents: 7277
diff changeset
14 ngx_str_t tag;
29adacffdefa Syslog: removed usage of ngx_cycle->log and ngx_cycle->hostname.
Maxim Dounin <mdounin@mdounin.ru>
parents: 7277
diff changeset
15
29adacffdefa Syslog: removed usage of ngx_cycle->log and ngx_cycle->hostname.
Maxim Dounin <mdounin@mdounin.ru>
parents: 7277
diff changeset
16 ngx_str_t *hostname;
5702
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
17
8149
29adacffdefa Syslog: removed usage of ngx_cycle->log and ngx_cycle->hostname.
Maxim Dounin <mdounin@mdounin.ru>
parents: 7277
diff changeset
18 ngx_addr_t server;
29adacffdefa Syslog: removed usage of ngx_cycle->log and ngx_cycle->hostname.
Maxim Dounin <mdounin@mdounin.ru>
parents: 7277
diff changeset
19 ngx_connection_t conn;
29adacffdefa Syslog: removed usage of ngx_cycle->log and ngx_cycle->hostname.
Maxim Dounin <mdounin@mdounin.ru>
parents: 7277
diff changeset
20
8150
8771d35d55d0 Syslog: introduced error log handler.
Maxim Dounin <mdounin@mdounin.ru>
parents: 8149
diff changeset
21 ngx_log_t log;
8771d35d55d0 Syslog: introduced error log handler.
Maxim Dounin <mdounin@mdounin.ru>
parents: 8149
diff changeset
22 ngx_log_t *logp;
8149
29adacffdefa Syslog: removed usage of ngx_cycle->log and ngx_cycle->hostname.
Maxim Dounin <mdounin@mdounin.ru>
parents: 7277
diff changeset
23
9225
1c9264603adc Syslog: introduced ngx_syslog_send() error logging moderation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 8150
diff changeset
24 time_t error_log_time;
1c9264603adc Syslog: introduced ngx_syslog_send() error logging moderation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 8150
diff changeset
25 time_t connect_error_time;
1c9264603adc Syslog: introduced ngx_syslog_send() error logging moderation.
Maxim Dounin <mdounin@mdounin.ru>
parents: 8150
diff changeset
26
8149
29adacffdefa Syslog: removed usage of ngx_cycle->log and ngx_cycle->hostname.
Maxim Dounin <mdounin@mdounin.ru>
parents: 7277
diff changeset
27 unsigned busy:1;
29adacffdefa Syslog: removed usage of ngx_cycle->log and ngx_cycle->hostname.
Maxim Dounin <mdounin@mdounin.ru>
parents: 7277
diff changeset
28 unsigned nohostname:1;
5702
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
29 } ngx_syslog_peer_t;
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
30
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
31
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
32 char *ngx_syslog_process_conf(ngx_conf_t *cf, ngx_syslog_peer_t *peer);
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
33 u_char *ngx_syslog_add_header(ngx_syslog_peer_t *peer, u_char *buf);
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
34 void ngx_syslog_writer(ngx_log_t *log, ngx_uint_t level, u_char *buf,
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
35 size_t len);
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
36 ssize_t ngx_syslog_send(ngx_syslog_peer_t *peer, u_char *buf, size_t len);
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
37
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
38
777202558122 Added syslog support for error_log and access_log directives.
Vladimir Homutov <vl@nginx.com>
parents:
diff changeset
39 #endif /* _NGX_SYSLOG_H_INCLUDED_ */