nginxtra 1.4.7.9 → 1.6.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/nginxtra +1 -1
- data/bin/nginxtra_rails +1 -1
- data/lib/nginxtra/version.rb +1 -1
- data/vendor/nginx/CHANGES +286 -19
- data/vendor/nginx/CHANGES.ru +296 -22
- data/vendor/nginx/auto/cc/clang +4 -3
- data/vendor/nginx/auto/cc/conf +23 -0
- data/vendor/nginx/auto/cc/msvc +1 -0
- data/vendor/nginx/auto/cc/name +1 -1
- data/vendor/nginx/auto/cc/owc +4 -4
- data/vendor/nginx/auto/cc/sunc +1 -1
- data/vendor/nginx/auto/endianness +2 -2
- data/vendor/nginx/auto/feature +1 -1
- data/vendor/nginx/auto/include +1 -1
- data/vendor/nginx/auto/lib/libatomic/make +3 -1
- data/vendor/nginx/auto/lib/openssl/conf +4 -0
- data/vendor/nginx/auto/lib/openssl/make +1 -1
- data/vendor/nginx/auto/lib/pcre/conf +5 -0
- data/vendor/nginx/auto/lib/pcre/make +11 -11
- data/vendor/nginx/auto/lib/pcre/makefile.bcc +4 -3
- data/vendor/nginx/auto/lib/pcre/makefile.msvc +2 -1
- data/vendor/nginx/auto/lib/pcre/makefile.owc +2 -1
- data/vendor/nginx/auto/lib/perl/make +1 -0
- data/vendor/nginx/auto/lib/test +1 -1
- data/vendor/nginx/auto/lib/zlib/make +22 -1
- data/vendor/nginx/auto/modules +8 -0
- data/vendor/nginx/auto/options +3 -0
- data/vendor/nginx/auto/os/darwin +1 -1
- data/vendor/nginx/auto/os/linux +32 -0
- data/vendor/nginx/auto/os/win32 +12 -1
- data/vendor/nginx/auto/sources +8 -2
- data/vendor/nginx/auto/types/sizeof +1 -1
- data/vendor/nginx/auto/types/typedef +1 -1
- data/vendor/nginx/auto/types/uintptr_t +1 -1
- data/vendor/nginx/auto/unix +13 -1
- data/vendor/nginx/conf/mime.types +11 -2
- data/vendor/nginx/conf/nginx.conf +3 -4
- data/vendor/nginx/contrib/README +6 -0
- data/vendor/nginx/contrib/vim/ftdetect/nginx.vim +4 -0
- data/vendor/nginx/contrib/vim/indent/nginx.vim +11 -0
- data/vendor/nginx/contrib/vim/syntax/nginx.vim +703 -0
- data/vendor/nginx/src/core/nginx.c +2 -7
- data/vendor/nginx/src/core/nginx.h +2 -2
- data/vendor/nginx/src/core/ngx_conf_file.c +8 -88
- data/vendor/nginx/src/core/ngx_conf_file.h +3 -3
- data/vendor/nginx/src/core/ngx_config.h +2 -2
- data/vendor/nginx/src/core/ngx_connection.c +100 -29
- data/vendor/nginx/src/core/ngx_connection.h +11 -0
- data/vendor/nginx/src/core/ngx_core.h +1 -0
- data/vendor/nginx/src/core/ngx_cycle.c +23 -99
- data/vendor/nginx/src/core/ngx_cycle.h +2 -0
- data/vendor/nginx/src/core/ngx_file.c +100 -8
- data/vendor/nginx/src/core/ngx_file.h +3 -0
- data/vendor/nginx/src/core/ngx_hash.c +6 -9
- data/vendor/nginx/src/core/ngx_inet.c +93 -5
- data/vendor/nginx/src/core/ngx_inet.h +4 -2
- data/vendor/nginx/src/core/ngx_list.c +1 -9
- data/vendor/nginx/src/core/ngx_log.c +132 -30
- data/vendor/nginx/src/core/ngx_log.h +5 -2
- data/vendor/nginx/src/core/ngx_open_file_cache.c +67 -1
- data/vendor/nginx/src/core/ngx_palloc.c +5 -2
- data/vendor/nginx/src/core/ngx_proxy_protocol.c +91 -0
- data/vendor/nginx/src/core/ngx_proxy_protocol.h +23 -0
- data/vendor/nginx/src/core/ngx_resolver.c +1080 -285
- data/vendor/nginx/src/core/ngx_resolver.h +33 -3
- data/vendor/nginx/src/core/ngx_slab.c +7 -2
- data/vendor/nginx/src/core/ngx_slab.h +2 -0
- data/vendor/nginx/src/core/ngx_string.c +78 -13
- data/vendor/nginx/src/core/ngx_string.h +2 -0
- data/vendor/nginx/src/event/modules/ngx_devpoll_module.c +2 -2
- data/vendor/nginx/src/event/modules/ngx_epoll_module.c +13 -5
- data/vendor/nginx/src/event/modules/ngx_select_module.c +1 -1
- data/vendor/nginx/src/event/modules/ngx_win32_select_module.c +2 -2
- data/vendor/nginx/src/event/ngx_event.c +0 -1
- data/vendor/nginx/src/event/ngx_event.h +7 -6
- data/vendor/nginx/src/event/ngx_event_accept.c +6 -4
- data/vendor/nginx/src/event/ngx_event_connect.c +2 -2
- data/vendor/nginx/src/event/ngx_event_openssl.c +304 -13
- data/vendor/nginx/src/event/ngx_event_openssl.h +20 -1
- data/vendor/nginx/src/event/ngx_event_openssl_stapling.c +35 -23
- data/vendor/nginx/src/event/ngx_event_pipe.c +15 -30
- data/vendor/nginx/src/http/modules/ngx_http_access_module.c +115 -35
- data/vendor/nginx/src/http/modules/ngx_http_auth_basic_module.c +1 -1
- data/vendor/nginx/src/http/modules/ngx_http_auth_request_module.c +444 -0
- data/vendor/nginx/src/http/modules/ngx_http_autoindex_module.c +2 -1
- data/vendor/nginx/src/http/modules/ngx_http_charset_filter_module.c +1 -1
- data/vendor/nginx/src/http/modules/ngx_http_dav_module.c +1 -3
- data/vendor/nginx/src/http/modules/ngx_http_fastcgi_module.c +251 -36
- data/vendor/nginx/src/http/modules/ngx_http_gunzip_filter_module.c +9 -5
- data/vendor/nginx/src/http/modules/ngx_http_gzip_filter_module.c +5 -3
- data/vendor/nginx/src/http/modules/ngx_http_gzip_static_module.c +1 -1
- data/vendor/nginx/src/http/modules/ngx_http_headers_filter_module.c +4 -0
- data/vendor/nginx/src/http/modules/ngx_http_image_filter_module.c +8 -2
- data/vendor/nginx/src/http/modules/ngx_http_limit_req_module.c +5 -1
- data/vendor/nginx/src/http/modules/ngx_http_map_module.c +3 -3
- data/vendor/nginx/src/http/modules/ngx_http_memcached_module.c +21 -10
- data/vendor/nginx/src/http/modules/ngx_http_mp4_module.c +669 -197
- data/vendor/nginx/src/http/modules/ngx_http_proxy_module.c +93 -60
- data/vendor/nginx/src/http/modules/ngx_http_range_filter_module.c +13 -6
- data/vendor/nginx/src/http/modules/ngx_http_realip_module.c +20 -1
- data/vendor/nginx/src/http/modules/ngx_http_referer_module.c +132 -74
- data/vendor/nginx/src/http/modules/ngx_http_scgi_module.c +18 -12
- data/vendor/nginx/src/http/modules/ngx_http_ssi_filter_module.c +22 -20
- data/vendor/nginx/src/http/modules/ngx_http_ssl_module.c +121 -3
- data/vendor/nginx/src/http/modules/ngx_http_ssl_module.h +5 -0
- data/vendor/nginx/src/http/modules/ngx_http_stub_status_module.c +3 -0
- data/vendor/nginx/src/http/modules/ngx_http_sub_filter_module.c +123 -91
- data/vendor/nginx/src/http/modules/ngx_http_upstream_ip_hash_module.c +29 -19
- data/vendor/nginx/src/http/modules/ngx_http_upstream_keepalive_module.c +2 -5
- data/vendor/nginx/src/http/modules/ngx_http_uwsgi_module.c +215 -19
- data/vendor/nginx/src/http/modules/ngx_http_xslt_filter_module.c +32 -6
- data/vendor/nginx/src/http/modules/perl/nginx.xs +4 -7
- data/vendor/nginx/src/http/modules/perl/ngx_http_perl_module.c +2 -2
- data/vendor/nginx/src/http/ngx_http.c +17 -7
- data/vendor/nginx/src/http/ngx_http_cache.h +4 -2
- data/vendor/nginx/src/http/ngx_http_copy_filter_module.c +4 -2
- data/vendor/nginx/src/http/ngx_http_core_module.c +63 -50
- data/vendor/nginx/src/http/ngx_http_core_module.h +5 -0
- data/vendor/nginx/src/http/ngx_http_file_cache.c +115 -3
- data/vendor/nginx/src/http/ngx_http_header_filter_module.c +9 -6
- data/vendor/nginx/src/http/ngx_http_parse.c +88 -10
- data/vendor/nginx/src/http/ngx_http_postpone_filter_module.c +2 -4
- data/vendor/nginx/src/http/ngx_http_request.c +116 -8
- data/vendor/nginx/src/http/ngx_http_request.h +5 -1
- data/vendor/nginx/src/http/ngx_http_request_body.c +7 -7
- data/vendor/nginx/src/http/ngx_http_script.c +6 -5
- data/vendor/nginx/src/http/ngx_http_spdy.c +889 -271
- data/vendor/nginx/src/http/ngx_http_spdy.h +51 -28
- data/vendor/nginx/src/http/ngx_http_spdy_filter_module.c +382 -167
- data/vendor/nginx/src/http/ngx_http_spdy_module.c +65 -8
- data/vendor/nginx/src/http/ngx_http_spdy_module.h +5 -0
- data/vendor/nginx/src/http/ngx_http_special_response.c +1 -1
- data/vendor/nginx/src/http/ngx_http_upstream.c +290 -114
- data/vendor/nginx/src/http/ngx_http_upstream.h +9 -5
- data/vendor/nginx/src/http/ngx_http_upstream_round_robin.c +32 -24
- data/vendor/nginx/src/http/ngx_http_variables.c +40 -6
- data/vendor/nginx/src/http/ngx_http_write_filter_module.c +12 -5
- data/vendor/nginx/src/mail/ngx_mail.c +4 -2
- data/vendor/nginx/src/mail/ngx_mail.h +2 -0
- data/vendor/nginx/src/mail/ngx_mail_auth_http_module.c +0 -1
- data/vendor/nginx/src/mail/ngx_mail_core_module.c +2 -1
- data/vendor/nginx/src/mail/ngx_mail_handler.c +17 -4
- data/vendor/nginx/src/mail/ngx_mail_parse.c +32 -2
- data/vendor/nginx/src/mail/ngx_mail_proxy_module.c +54 -7
- data/vendor/nginx/src/mail/ngx_mail_smtp_handler.c +50 -78
- data/vendor/nginx/src/mail/ngx_mail_ssl_module.c +48 -11
- data/vendor/nginx/src/mail/ngx_mail_ssl_module.h +3 -0
- data/vendor/nginx/src/os/unix/ngx_channel.c +3 -1
- data/vendor/nginx/src/os/unix/ngx_darwin_config.h +1 -0
- data/vendor/nginx/src/os/unix/ngx_darwin_init.c +1 -1
- data/vendor/nginx/src/os/unix/ngx_darwin_sendfile_chain.c +14 -16
- data/vendor/nginx/src/os/unix/ngx_errno.h +3 -0
- data/vendor/nginx/src/os/unix/ngx_files.h +10 -16
- data/vendor/nginx/src/os/unix/ngx_freebsd_config.h +6 -0
- data/vendor/nginx/src/os/unix/ngx_freebsd_init.c +1 -1
- data/vendor/nginx/src/os/unix/ngx_freebsd_rfork_thread.c +1 -1
- data/vendor/nginx/src/os/unix/ngx_freebsd_rfork_thread.h +2 -2
- data/vendor/nginx/src/os/unix/ngx_freebsd_sendfile_chain.c +17 -19
- data/vendor/nginx/src/os/unix/ngx_linux_config.h +8 -2
- data/vendor/nginx/src/os/unix/ngx_linux_sendfile_chain.c +20 -22
- data/vendor/nginx/src/os/unix/ngx_posix_config.h +1 -0
- data/vendor/nginx/src/os/unix/ngx_process.c +5 -0
- data/vendor/nginx/src/os/unix/ngx_process_cycle.c +15 -3
- data/vendor/nginx/src/os/unix/ngx_readv_chain.c +2 -1
- data/vendor/nginx/src/os/unix/ngx_recv.c +4 -1
- data/vendor/nginx/src/os/unix/ngx_solaris_config.h +1 -0
- data/vendor/nginx/src/os/unix/ngx_solaris_sendfilev_chain.c +14 -16
- metadata +8 -2
@@ -18,6 +18,9 @@
|
|
18
18
|
#define NGX_RESOLVE_PTR 12
|
19
19
|
#define NGX_RESOLVE_MX 15
|
20
20
|
#define NGX_RESOLVE_TXT 16
|
21
|
+
#if (NGX_HAVE_INET6)
|
22
|
+
#define NGX_RESOLVE_AAAA 28
|
23
|
+
#endif
|
21
24
|
#define NGX_RESOLVE_DNAME 39
|
22
25
|
|
23
26
|
#define NGX_RESOLVE_FORMERR 1
|
@@ -54,10 +57,18 @@ typedef struct {
|
|
54
57
|
/* PTR: resolved name, A: name to resolve */
|
55
58
|
u_char *name;
|
56
59
|
|
60
|
+
#if (NGX_HAVE_INET6)
|
61
|
+
/* PTR: IPv6 address to resolve (IPv4 address is in rbtree node key) */
|
62
|
+
struct in6_addr addr6;
|
63
|
+
#endif
|
64
|
+
|
57
65
|
u_short nlen;
|
58
66
|
u_short qlen;
|
59
67
|
|
60
68
|
u_char *query;
|
69
|
+
#if (NGX_HAVE_INET6)
|
70
|
+
u_char *query6;
|
71
|
+
#endif
|
61
72
|
|
62
73
|
union {
|
63
74
|
in_addr_t addr;
|
@@ -65,11 +76,22 @@ typedef struct {
|
|
65
76
|
u_char *cname;
|
66
77
|
} u;
|
67
78
|
|
79
|
+
u_char code;
|
68
80
|
u_short naddrs;
|
69
81
|
u_short cnlen;
|
70
82
|
|
83
|
+
#if (NGX_HAVE_INET6)
|
84
|
+
union {
|
85
|
+
struct in6_addr addr6;
|
86
|
+
struct in6_addr *addrs6;
|
87
|
+
} u6;
|
88
|
+
|
89
|
+
u_short naddrs6;
|
90
|
+
#endif
|
91
|
+
|
71
92
|
time_t expire;
|
72
93
|
time_t valid;
|
94
|
+
uint32_t ttl;
|
73
95
|
|
74
96
|
ngx_resolver_ctx_t *waiting;
|
75
97
|
} ngx_resolver_node_t;
|
@@ -100,6 +122,14 @@ typedef struct {
|
|
100
122
|
ngx_queue_t name_expire_queue;
|
101
123
|
ngx_queue_t addr_expire_queue;
|
102
124
|
|
125
|
+
#if (NGX_HAVE_INET6)
|
126
|
+
ngx_uint_t ipv6; /* unsigned ipv6:1; */
|
127
|
+
ngx_rbtree_t addr6_rbtree;
|
128
|
+
ngx_rbtree_node_t addr6_sentinel;
|
129
|
+
ngx_queue_t addr6_resend_queue;
|
130
|
+
ngx_queue_t addr6_expire_queue;
|
131
|
+
#endif
|
132
|
+
|
103
133
|
time_t resend_timeout;
|
104
134
|
time_t expire;
|
105
135
|
time_t valid;
|
@@ -117,12 +147,12 @@ struct ngx_resolver_ctx_s {
|
|
117
147
|
ngx_int_t ident;
|
118
148
|
|
119
149
|
ngx_int_t state;
|
120
|
-
ngx_int_t type;
|
121
150
|
ngx_str_t name;
|
122
151
|
|
123
152
|
ngx_uint_t naddrs;
|
124
|
-
|
125
|
-
|
153
|
+
ngx_addr_t *addrs;
|
154
|
+
ngx_addr_t addr;
|
155
|
+
struct sockaddr_in sin;
|
126
156
|
|
127
157
|
ngx_resolver_handler_pt handler;
|
128
158
|
void *data;
|
@@ -129,6 +129,7 @@ ngx_slab_init(ngx_slab_pool_t *pool)
|
|
129
129
|
pool->pages->slab = pages;
|
130
130
|
}
|
131
131
|
|
132
|
+
pool->log_nomem = 1;
|
132
133
|
pool->log_ctx = &pool->zero;
|
133
134
|
pool->zero = '\0';
|
134
135
|
}
|
@@ -440,7 +441,8 @@ ngx_slab_free_locked(ngx_slab_pool_t *pool, void *p)
|
|
440
441
|
n = ((uintptr_t) p & (ngx_pagesize - 1)) >> shift;
|
441
442
|
m = (uintptr_t) 1 << (n & (sizeof(uintptr_t) * 8 - 1));
|
442
443
|
n /= (sizeof(uintptr_t) * 8);
|
443
|
-
bitmap = (uintptr_t *)
|
444
|
+
bitmap = (uintptr_t *)
|
445
|
+
((uintptr_t) p & ~((uintptr_t) ngx_pagesize - 1));
|
444
446
|
|
445
447
|
if (bitmap[n] & m) {
|
446
448
|
|
@@ -657,7 +659,10 @@ ngx_slab_alloc_pages(ngx_slab_pool_t *pool, ngx_uint_t pages)
|
|
657
659
|
}
|
658
660
|
}
|
659
661
|
|
660
|
-
|
662
|
+
if (pool->log_nomem) {
|
663
|
+
ngx_slab_error(pool, NGX_LOG_CRIT,
|
664
|
+
"ngx_slab_alloc() failed: no memory");
|
665
|
+
}
|
661
666
|
|
662
667
|
return NULL;
|
663
668
|
}
|
@@ -11,6 +11,8 @@
|
|
11
11
|
|
12
12
|
static u_char *ngx_sprintf_num(u_char *buf, u_char *last, uint64_t ui64,
|
13
13
|
u_char zero, ngx_uint_t hexadecimal, ngx_uint_t width);
|
14
|
+
static void ngx_encode_base64_internal(ngx_str_t *dst, ngx_str_t *src,
|
15
|
+
const u_char *basis, ngx_uint_t padding);
|
14
16
|
static ngx_int_t ngx_decode_base64_internal(ngx_str_t *dst, ngx_str_t *src,
|
15
17
|
const u_char *basis);
|
16
18
|
|
@@ -486,7 +488,7 @@ ngx_sprintf_num(u_char *buf, u_char *last, uint64_t ui64, u_char zero,
|
|
486
488
|
|
487
489
|
if (hexadecimal == 0) {
|
488
490
|
|
489
|
-
if (ui64 <= NGX_MAX_UINT32_VALUE) {
|
491
|
+
if (ui64 <= (uint64_t) NGX_MAX_UINT32_VALUE) {
|
490
492
|
|
491
493
|
/*
|
492
494
|
* To divide 64-bit numbers and to find remainders
|
@@ -852,6 +854,46 @@ ngx_dns_strcmp(u_char *s1, u_char *s2)
|
|
852
854
|
}
|
853
855
|
|
854
856
|
|
857
|
+
ngx_int_t
|
858
|
+
ngx_filename_cmp(u_char *s1, u_char *s2, size_t n)
|
859
|
+
{
|
860
|
+
ngx_uint_t c1, c2;
|
861
|
+
|
862
|
+
while (n) {
|
863
|
+
c1 = (ngx_uint_t) *s1++;
|
864
|
+
c2 = (ngx_uint_t) *s2++;
|
865
|
+
|
866
|
+
#if (NGX_HAVE_CASELESS_FILESYSTEM)
|
867
|
+
c1 = tolower(c1);
|
868
|
+
c2 = tolower(c2);
|
869
|
+
#endif
|
870
|
+
|
871
|
+
if (c1 == c2) {
|
872
|
+
|
873
|
+
if (c1) {
|
874
|
+
n--;
|
875
|
+
continue;
|
876
|
+
}
|
877
|
+
|
878
|
+
return 0;
|
879
|
+
}
|
880
|
+
|
881
|
+
/* we need '/' to be the lowest character */
|
882
|
+
|
883
|
+
if (c1 == 0 || c2 == 0) {
|
884
|
+
return c1 - c2;
|
885
|
+
}
|
886
|
+
|
887
|
+
c1 = (c1 == '/') ? 0 : c1;
|
888
|
+
c2 = (c2 == '/') ? 0 : c2;
|
889
|
+
|
890
|
+
return c1 - c2;
|
891
|
+
}
|
892
|
+
|
893
|
+
return 0;
|
894
|
+
}
|
895
|
+
|
896
|
+
|
855
897
|
ngx_int_t
|
856
898
|
ngx_atoi(u_char *line, size_t n)
|
857
899
|
{
|
@@ -1060,38 +1102,61 @@ ngx_hex_dump(u_char *dst, u_char *src, size_t len)
|
|
1060
1102
|
void
|
1061
1103
|
ngx_encode_base64(ngx_str_t *dst, ngx_str_t *src)
|
1062
1104
|
{
|
1063
|
-
u_char *d, *s;
|
1064
|
-
size_t len;
|
1065
1105
|
static u_char basis64[] =
|
1066
1106
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
1067
1107
|
|
1108
|
+
ngx_encode_base64_internal(dst, src, basis64, 1);
|
1109
|
+
}
|
1110
|
+
|
1111
|
+
|
1112
|
+
void
|
1113
|
+
ngx_encode_base64url(ngx_str_t *dst, ngx_str_t *src)
|
1114
|
+
{
|
1115
|
+
static u_char basis64[] =
|
1116
|
+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
1117
|
+
|
1118
|
+
ngx_encode_base64_internal(dst, src, basis64, 0);
|
1119
|
+
}
|
1120
|
+
|
1121
|
+
|
1122
|
+
static void
|
1123
|
+
ngx_encode_base64_internal(ngx_str_t *dst, ngx_str_t *src, const u_char *basis,
|
1124
|
+
ngx_uint_t padding)
|
1125
|
+
{
|
1126
|
+
u_char *d, *s;
|
1127
|
+
size_t len;
|
1128
|
+
|
1068
1129
|
len = src->len;
|
1069
1130
|
s = src->data;
|
1070
1131
|
d = dst->data;
|
1071
1132
|
|
1072
1133
|
while (len > 2) {
|
1073
|
-
*d++ =
|
1074
|
-
*d++ =
|
1075
|
-
*d++ =
|
1076
|
-
*d++ =
|
1134
|
+
*d++ = basis[(s[0] >> 2) & 0x3f];
|
1135
|
+
*d++ = basis[((s[0] & 3) << 4) | (s[1] >> 4)];
|
1136
|
+
*d++ = basis[((s[1] & 0x0f) << 2) | (s[2] >> 6)];
|
1137
|
+
*d++ = basis[s[2] & 0x3f];
|
1077
1138
|
|
1078
1139
|
s += 3;
|
1079
1140
|
len -= 3;
|
1080
1141
|
}
|
1081
1142
|
|
1082
1143
|
if (len) {
|
1083
|
-
*d++ =
|
1144
|
+
*d++ = basis[(s[0] >> 2) & 0x3f];
|
1084
1145
|
|
1085
1146
|
if (len == 1) {
|
1086
|
-
*d++ =
|
1087
|
-
|
1147
|
+
*d++ = basis[(s[0] & 3) << 4];
|
1148
|
+
if (padding) {
|
1149
|
+
*d++ = '=';
|
1150
|
+
}
|
1088
1151
|
|
1089
1152
|
} else {
|
1090
|
-
*d++ =
|
1091
|
-
*d++ =
|
1153
|
+
*d++ = basis[((s[0] & 3) << 4) | (s[1] >> 4)];
|
1154
|
+
*d++ = basis[(s[1] & 0x0f) << 2];
|
1092
1155
|
}
|
1093
1156
|
|
1094
|
-
|
1157
|
+
if (padding) {
|
1158
|
+
*d++ = '=';
|
1159
|
+
}
|
1095
1160
|
}
|
1096
1161
|
|
1097
1162
|
dst->len = d - dst->data;
|
@@ -167,6 +167,7 @@ ngx_int_t ngx_rstrncmp(u_char *s1, u_char *s2, size_t n);
|
|
167
167
|
ngx_int_t ngx_rstrncasecmp(u_char *s1, u_char *s2, size_t n);
|
168
168
|
ngx_int_t ngx_memn2cmp(u_char *s1, u_char *s2, size_t n1, size_t n2);
|
169
169
|
ngx_int_t ngx_dns_strcmp(u_char *s1, u_char *s2);
|
170
|
+
ngx_int_t ngx_filename_cmp(u_char *s1, u_char *s2, size_t n);
|
170
171
|
|
171
172
|
ngx_int_t ngx_atoi(u_char *line, size_t n);
|
172
173
|
ngx_int_t ngx_atofp(u_char *line, size_t n, size_t point);
|
@@ -182,6 +183,7 @@ u_char *ngx_hex_dump(u_char *dst, u_char *src, size_t len);
|
|
182
183
|
#define ngx_base64_decoded_length(len) (((len + 3) / 4) * 3)
|
183
184
|
|
184
185
|
void ngx_encode_base64(ngx_str_t *dst, ngx_str_t *src);
|
186
|
+
void ngx_encode_base64url(ngx_str_t *dst, ngx_str_t *src);
|
185
187
|
ngx_int_t ngx_decode_base64(ngx_str_t *dst, ngx_str_t *src);
|
186
188
|
ngx_int_t ngx_decode_base64url(ngx_str_t *dst, ngx_str_t *src);
|
187
189
|
|
@@ -425,7 +425,7 @@ ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|
425
425
|
|
426
426
|
case -1:
|
427
427
|
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
|
428
|
-
"ioctl(DP_ISPOLLED) failed for socket %d, event",
|
428
|
+
"ioctl(DP_ISPOLLED) failed for socket %d, event %04Xd",
|
429
429
|
fd, revents);
|
430
430
|
break;
|
431
431
|
|
@@ -449,7 +449,7 @@ ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|
449
449
|
!= (ssize_t) sizeof(struct pollfd))
|
450
450
|
{
|
451
451
|
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
|
452
|
-
"write(/dev/poll) for %d failed, fd
|
452
|
+
"write(/dev/poll) for %d failed", fd);
|
453
453
|
}
|
454
454
|
|
455
455
|
if (close(fd) == -1) {
|
@@ -25,6 +25,8 @@
|
|
25
25
|
#define EPOLLERR 0x008
|
26
26
|
#define EPOLLHUP 0x010
|
27
27
|
|
28
|
+
#define EPOLLRDHUP 0x2000
|
29
|
+
|
28
30
|
#define EPOLLET 0x80000000
|
29
31
|
#define EPOLLONESHOT 0x40000000
|
30
32
|
|
@@ -396,13 +398,13 @@ ngx_epoll_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
|
|
396
398
|
if (event == NGX_READ_EVENT) {
|
397
399
|
e = c->write;
|
398
400
|
prev = EPOLLOUT;
|
399
|
-
#if (NGX_READ_EVENT != EPOLLIN)
|
400
|
-
events = EPOLLIN;
|
401
|
+
#if (NGX_READ_EVENT != EPOLLIN|EPOLLRDHUP)
|
402
|
+
events = EPOLLIN|EPOLLRDHUP;
|
401
403
|
#endif
|
402
404
|
|
403
405
|
} else {
|
404
406
|
e = c->read;
|
405
|
-
prev = EPOLLIN;
|
407
|
+
prev = EPOLLIN|EPOLLRDHUP;
|
406
408
|
#if (NGX_WRITE_EVENT != EPOLLOUT)
|
407
409
|
events = EPOLLOUT;
|
408
410
|
#endif
|
@@ -466,7 +468,7 @@ ngx_epoll_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
|
|
466
468
|
|
467
469
|
} else {
|
468
470
|
e = c->read;
|
469
|
-
prev = EPOLLIN;
|
471
|
+
prev = EPOLLIN|EPOLLRDHUP;
|
470
472
|
}
|
471
473
|
|
472
474
|
if (e->active) {
|
@@ -501,7 +503,7 @@ ngx_epoll_add_connection(ngx_connection_t *c)
|
|
501
503
|
{
|
502
504
|
struct epoll_event ee;
|
503
505
|
|
504
|
-
ee.events = EPOLLIN|EPOLLOUT|EPOLLET;
|
506
|
+
ee.events = EPOLLIN|EPOLLOUT|EPOLLET|EPOLLRDHUP;
|
505
507
|
ee.data.ptr = (void *) ((uintptr_t) c | c->read->instance);
|
506
508
|
|
507
509
|
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
|
@@ -666,6 +668,12 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|
666
668
|
|
667
669
|
if ((revents & EPOLLIN) && rev->active) {
|
668
670
|
|
671
|
+
#if (NGX_HAVE_EPOLLRDHUP)
|
672
|
+
if (revents & EPOLLRDHUP) {
|
673
|
+
rev->pending_eof = 1;
|
674
|
+
}
|
675
|
+
#endif
|
676
|
+
|
669
677
|
if ((flags & NGX_POST_THREAD_EVENTS) && !rev->accept) {
|
670
678
|
rev->posted_ready = 1;
|
671
679
|
|
@@ -148,8 +148,8 @@ ngx_select_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
|
|
148
148
|
return NGX_ERROR;
|
149
149
|
}
|
150
150
|
|
151
|
-
if ((event == NGX_READ_EVENT
|
152
|
-
|| (event == NGX_WRITE_EVENT
|
151
|
+
if ((event == NGX_READ_EVENT && max_read >= FD_SETSIZE)
|
152
|
+
|| (event == NGX_WRITE_EVENT && max_write >= FD_SETSIZE))
|
153
153
|
{
|
154
154
|
ngx_log_error(NGX_LOG_ERR, ev->log, 0,
|
155
155
|
"maximum number of descriptors "
|
@@ -69,13 +69,9 @@ struct ngx_event_s {
|
|
69
69
|
|
70
70
|
unsigned delayed:1;
|
71
71
|
|
72
|
-
unsigned read_discarded:1;
|
73
|
-
|
74
|
-
unsigned unexpected_eof:1;
|
75
|
-
|
76
72
|
unsigned deferred_accept:1;
|
77
73
|
|
78
|
-
/* the pending eof reported by kqueue or in aio chain operation */
|
74
|
+
/* the pending eof reported by kqueue, epoll or in aio chain operation */
|
79
75
|
unsigned pending_eof:1;
|
80
76
|
|
81
77
|
#if !(NGX_THREADS)
|
@@ -353,6 +349,11 @@ extern ngx_event_actions_t ngx_event_actions;
|
|
353
349
|
#define NGX_VNODE_EVENT 0
|
354
350
|
|
355
351
|
|
352
|
+
#if (NGX_HAVE_EPOLL) && !(NGX_HAVE_EPOLLRDHUP)
|
353
|
+
#define EPOLLRDHUP 0
|
354
|
+
#endif
|
355
|
+
|
356
|
+
|
356
357
|
#if (NGX_HAVE_KQUEUE)
|
357
358
|
|
358
359
|
#define NGX_READ_EVENT EVFILT_READ
|
@@ -396,7 +397,7 @@ extern ngx_event_actions_t ngx_event_actions;
|
|
396
397
|
|
397
398
|
#elif (NGX_HAVE_EPOLL)
|
398
399
|
|
399
|
-
#define NGX_READ_EVENT EPOLLIN
|
400
|
+
#define NGX_READ_EVENT (EPOLLIN|EPOLLRDHUP)
|
400
401
|
#define NGX_WRITE_EVENT EPOLLOUT
|
401
402
|
|
402
403
|
#define NGX_LEVEL_EVENT 0
|
@@ -70,7 +70,7 @@ ngx_event_accept(ngx_event_t *ev)
|
|
70
70
|
s = accept(lc->fd, (struct sockaddr *) sa, &socklen);
|
71
71
|
#endif
|
72
72
|
|
73
|
-
if (s == -1) {
|
73
|
+
if (s == (ngx_socket_t) -1) {
|
74
74
|
err = ngx_socket_errno;
|
75
75
|
|
76
76
|
if (err == NGX_EAGAIN) {
|
@@ -212,6 +212,7 @@ ngx_event_accept(ngx_event_t *ev)
|
|
212
212
|
c->socklen = socklen;
|
213
213
|
c->listening = ls;
|
214
214
|
c->local_sockaddr = ls->sockaddr;
|
215
|
+
c->local_socklen = ls->socklen;
|
215
216
|
|
216
217
|
c->unexpected_eof = 1;
|
217
218
|
|
@@ -275,7 +276,8 @@ ngx_event_accept(ngx_event_t *ev)
|
|
275
276
|
return;
|
276
277
|
}
|
277
278
|
|
278
|
-
c->addr_text.len = ngx_sock_ntop(c->sockaddr, c->
|
279
|
+
c->addr_text.len = ngx_sock_ntop(c->sockaddr, c->socklen,
|
280
|
+
c->addr_text.data,
|
279
281
|
ls->addr_text_max_len, 0);
|
280
282
|
if (c->addr_text.len == 0) {
|
281
283
|
ngx_close_accepted_connection(c);
|
@@ -296,7 +298,7 @@ ngx_event_accept(ngx_event_t *ev)
|
|
296
298
|
|
297
299
|
cidr = ecf->debug_connection.elts;
|
298
300
|
for (i = 0; i < ecf->debug_connection.nelts; i++) {
|
299
|
-
if (cidr[i].family != c->sockaddr->sa_family) {
|
301
|
+
if (cidr[i].family != (ngx_uint_t) c->sockaddr->sa_family) {
|
300
302
|
goto next;
|
301
303
|
}
|
302
304
|
|
@@ -342,7 +344,7 @@ ngx_event_accept(ngx_event_t *ev)
|
|
342
344
|
#endif
|
343
345
|
|
344
346
|
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0,
|
345
|
-
"*%
|
347
|
+
"*%uA accept: %V fd:%d", c->number, &c->addr_text, s);
|
346
348
|
|
347
349
|
if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) {
|
348
350
|
if (ngx_add_conn(c) == NGX_ERROR) {
|