nginxtra 1.8.1.12 → 1.10.1.12
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 +363 -25
- data/vendor/nginx/CHANGES.ru +365 -21
- data/vendor/nginx/LICENSE +2 -2
- data/vendor/nginx/auto/cc/conf +32 -0
- data/vendor/nginx/auto/cc/gcc +1 -1
- data/vendor/nginx/auto/cc/icc +2 -2
- data/vendor/nginx/auto/cc/msvc +29 -8
- data/vendor/nginx/auto/cc/name +2 -25
- data/vendor/nginx/auto/cc/sunc +3 -0
- data/vendor/nginx/auto/endianness +7 -2
- data/vendor/nginx/auto/install +60 -26
- data/vendor/nginx/auto/lib/conf +4 -4
- data/vendor/nginx/auto/lib/geoip/conf +6 -1
- data/vendor/nginx/auto/lib/libgd/conf +6 -1
- data/vendor/nginx/auto/lib/libxslt/conf +11 -2
- data/vendor/nginx/auto/lib/make +1 -1
- data/vendor/nginx/auto/lib/md5/conf +2 -2
- data/vendor/nginx/auto/lib/md5/make +2 -2
- data/vendor/nginx/auto/lib/openssl/conf +52 -3
- data/vendor/nginx/auto/lib/openssl/make +1 -1
- data/vendor/nginx/auto/lib/pcre/conf +2 -2
- data/vendor/nginx/auto/lib/pcre/make +2 -2
- data/vendor/nginx/auto/lib/perl/conf +6 -3
- data/vendor/nginx/auto/lib/perl/make +4 -1
- data/vendor/nginx/auto/lib/sha1/conf +2 -2
- data/vendor/nginx/auto/lib/sha1/make +2 -2
- data/vendor/nginx/auto/lib/zlib/conf +2 -2
- data/vendor/nginx/auto/lib/zlib/make +2 -2
- data/vendor/nginx/auto/make +281 -16
- data/vendor/nginx/auto/module +122 -0
- data/vendor/nginx/auto/modules +909 -178
- data/vendor/nginx/auto/options +81 -19
- data/vendor/nginx/auto/os/conf +9 -0
- data/vendor/nginx/auto/os/darwin +3 -0
- data/vendor/nginx/auto/os/freebsd +0 -20
- data/vendor/nginx/auto/os/linux +0 -12
- data/vendor/nginx/auto/os/win32 +5 -1
- data/vendor/nginx/auto/sources +11 -311
- data/vendor/nginx/auto/summary +1 -0
- data/vendor/nginx/auto/types/sizeof +5 -3
- data/vendor/nginx/auto/types/typedef +9 -4
- data/vendor/nginx/auto/types/uintptr_t +7 -2
- data/vendor/nginx/auto/unix +72 -12
- data/vendor/nginx/conf/fastcgi.conf +1 -0
- data/vendor/nginx/conf/fastcgi_params +1 -0
- data/vendor/nginx/conf/scgi_params +1 -0
- data/vendor/nginx/conf/uwsgi_params +1 -0
- data/vendor/nginx/configure +1 -1
- data/vendor/nginx/contrib/vim/syntax/nginx.vim +2 -2
- data/vendor/nginx/man/nginx.8 +6 -2
- data/vendor/nginx/src/core/nginx.c +281 -114
- data/vendor/nginx/src/core/nginx.h +2 -2
- data/vendor/nginx/src/core/ngx_conf_file.c +54 -13
- data/vendor/nginx/src/core/ngx_conf_file.h +8 -52
- data/vendor/nginx/src/core/ngx_config.h +0 -5
- data/vendor/nginx/src/core/ngx_connection.c +270 -37
- data/vendor/nginx/src/core/ngx_connection.h +35 -12
- data/vendor/nginx/src/core/ngx_core.h +4 -0
- data/vendor/nginx/src/core/ngx_crypt.c +2 -2
- data/vendor/nginx/src/core/ngx_cycle.c +72 -25
- data/vendor/nginx/src/core/ngx_cycle.h +28 -39
- data/vendor/nginx/src/core/ngx_file.c +14 -5
- data/vendor/nginx/src/core/ngx_file.h +2 -0
- data/vendor/nginx/src/core/ngx_hash.c +13 -1
- data/vendor/nginx/src/core/ngx_inet.c +20 -18
- data/vendor/nginx/src/core/ngx_log.c +12 -12
- data/vendor/nginx/src/core/ngx_log.h +13 -6
- data/vendor/nginx/src/core/ngx_module.c +360 -0
- data/vendor/nginx/src/core/ngx_module.h +307 -0
- data/vendor/nginx/src/core/ngx_open_file_cache.c +2 -2
- data/vendor/nginx/src/core/ngx_output_chain.c +8 -4
- data/vendor/nginx/src/core/ngx_palloc.c +42 -44
- data/vendor/nginx/src/{http/ngx_http_parse_time.c → core/ngx_parse_time.c} +2 -3
- data/vendor/nginx/src/core/ngx_parse_time.h +22 -0
- data/vendor/nginx/src/core/ngx_proxy_protocol.c +50 -1
- data/vendor/nginx/src/core/ngx_proxy_protocol.h +3 -1
- data/vendor/nginx/src/core/ngx_regex.c +1 -38
- data/vendor/nginx/src/core/ngx_resolver.c +1814 -320
- data/vendor/nginx/src/core/ngx_resolver.h +67 -10
- data/vendor/nginx/src/core/ngx_rwlock.c +120 -0
- data/vendor/nginx/src/core/ngx_rwlock.h +21 -0
- data/vendor/nginx/src/core/ngx_slab.c +6 -5
- data/vendor/nginx/src/core/ngx_string.c +1 -1
- data/vendor/nginx/src/core/ngx_syslog.c +11 -3
- data/vendor/nginx/src/core/ngx_syslog.h +2 -1
- data/vendor/nginx/src/core/ngx_thread_pool.c +4 -0
- data/vendor/nginx/src/core/ngx_times.c +2 -2
- data/vendor/nginx/src/event/modules/ngx_devpoll_module.c +3 -1
- data/vendor/nginx/src/event/modules/ngx_epoll_module.c +5 -2
- data/vendor/nginx/src/event/modules/ngx_eventport_module.c +5 -5
- data/vendor/nginx/src/event/modules/ngx_kqueue_module.c +15 -8
- data/vendor/nginx/src/event/modules/ngx_poll_module.c +0 -10
- data/vendor/nginx/src/event/modules/ngx_select_module.c +0 -10
- data/vendor/nginx/src/event/ngx_event.c +60 -103
- data/vendor/nginx/src/event/ngx_event.h +22 -26
- data/vendor/nginx/src/event/ngx_event_accept.c +414 -88
- data/vendor/nginx/src/event/ngx_event_connect.c +27 -18
- data/vendor/nginx/src/event/ngx_event_connect.h +1 -0
- data/vendor/nginx/src/event/ngx_event_openssl.c +65 -25
- data/vendor/nginx/src/event/ngx_event_openssl.h +17 -0
- data/vendor/nginx/src/event/ngx_event_openssl_stapling.c +73 -7
- data/vendor/nginx/src/event/ngx_event_pipe.c +85 -27
- data/vendor/nginx/src/event/ngx_event_pipe.h +10 -0
- 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 +2 -2
- data/vendor/nginx/src/http/modules/ngx_http_chunked_filter_module.c +2 -2
- data/vendor/nginx/src/http/modules/ngx_http_dav_module.c +6 -6
- data/vendor/nginx/src/http/modules/ngx_http_fastcgi_module.c +17 -11
- data/vendor/nginx/src/http/modules/ngx_http_gzip_filter_module.c +2 -2
- data/vendor/nginx/src/http/modules/ngx_http_headers_filter_module.c +9 -9
- data/vendor/nginx/src/http/modules/ngx_http_image_filter_module.c +2 -2
- data/vendor/nginx/src/http/modules/ngx_http_limit_conn_module.c +2 -2
- data/vendor/nginx/src/http/modules/ngx_http_limit_req_module.c +0 -7
- data/vendor/nginx/src/http/modules/ngx_http_map_module.c +6 -6
- data/vendor/nginx/src/http/modules/ngx_http_memcached_module.c +2 -1
- data/vendor/nginx/src/http/modules/ngx_http_mp4_module.c +13 -13
- data/vendor/nginx/src/http/modules/ngx_http_not_modified_filter_module.c +2 -2
- data/vendor/nginx/src/http/modules/ngx_http_proxy_module.c +26 -21
- data/vendor/nginx/src/http/modules/ngx_http_random_index_module.c +1 -1
- data/vendor/nginx/src/http/modules/ngx_http_range_filter_module.c +26 -8
- data/vendor/nginx/src/http/modules/ngx_http_realip_module.c +73 -3
- data/vendor/nginx/src/http/modules/ngx_http_referer_module.c +1 -1
- data/vendor/nginx/src/http/modules/ngx_http_rewrite_module.c +6 -6
- data/vendor/nginx/src/http/modules/ngx_http_scgi_module.c +5 -3
- data/vendor/nginx/src/http/modules/ngx_http_slice_filter_module.c +526 -0
- data/vendor/nginx/src/http/modules/ngx_http_ssi_filter_module.c +7 -7
- data/vendor/nginx/src/http/modules/ngx_http_ssl_module.c +19 -16
- data/vendor/nginx/src/http/modules/ngx_http_static_module.c +1 -1
- data/vendor/nginx/src/http/modules/ngx_http_stub_status_module.c +1 -1
- data/vendor/nginx/src/http/modules/ngx_http_sub_filter_module.c +373 -173
- data/vendor/nginx/src/http/modules/ngx_http_upstream_hash_module.c +72 -46
- data/vendor/nginx/src/http/modules/ngx_http_upstream_ip_hash_module.c +18 -30
- data/vendor/nginx/src/http/modules/ngx_http_upstream_keepalive_module.c +50 -39
- data/vendor/nginx/src/http/modules/ngx_http_upstream_least_conn_module.c +38 -129
- data/vendor/nginx/src/http/modules/ngx_http_upstream_zone_module.c +246 -0
- data/vendor/nginx/src/http/modules/ngx_http_uwsgi_module.c +6 -5
- data/vendor/nginx/src/http/modules/perl/nginx.xs +9 -9
- data/vendor/nginx/src/http/ngx_http.c +46 -43
- data/vendor/nginx/src/http/ngx_http.h +4 -9
- data/vendor/nginx/src/http/ngx_http_cache.h +4 -0
- data/vendor/nginx/src/http/ngx_http_copy_filter_module.c +13 -5
- data/vendor/nginx/src/http/ngx_http_core_module.c +92 -91
- data/vendor/nginx/src/http/ngx_http_core_module.h +12 -8
- data/vendor/nginx/src/http/ngx_http_file_cache.c +61 -10
- data/vendor/nginx/src/http/ngx_http_request.c +37 -50
- data/vendor/nginx/src/http/ngx_http_request.h +10 -15
- data/vendor/nginx/src/http/ngx_http_request_body.c +64 -88
- data/vendor/nginx/src/http/ngx_http_script.c +3 -3
- data/vendor/nginx/src/http/ngx_http_special_response.c +1 -4
- data/vendor/nginx/src/http/ngx_http_upstream.c +245 -109
- data/vendor/nginx/src/http/ngx_http_upstream.h +11 -5
- data/vendor/nginx/src/http/ngx_http_upstream_round_robin.c +212 -65
- data/vendor/nginx/src/http/ngx_http_upstream_round_robin.h +66 -5
- data/vendor/nginx/src/http/ngx_http_variables.c +28 -15
- data/vendor/nginx/src/http/ngx_http_write_filter_module.c +1 -1
- data/vendor/nginx/src/http/v2/ngx_http_v2.c +4349 -0
- data/vendor/nginx/src/http/v2/ngx_http_v2.h +337 -0
- data/vendor/nginx/src/http/v2/ngx_http_v2_filter_module.c +1391 -0
- data/vendor/nginx/src/http/v2/ngx_http_v2_huff_decode.c +2714 -0
- data/vendor/nginx/src/http/v2/ngx_http_v2_huff_encode.c +254 -0
- data/vendor/nginx/src/http/v2/ngx_http_v2_module.c +469 -0
- data/vendor/nginx/src/http/{ngx_http_spdy_module.h → v2/ngx_http_v2_module.h} +10 -9
- data/vendor/nginx/src/http/v2/ngx_http_v2_table.c +349 -0
- data/vendor/nginx/src/mail/ngx_mail.c +49 -82
- data/vendor/nginx/src/mail/ngx_mail.h +16 -23
- data/vendor/nginx/src/mail/ngx_mail_auth_http_module.c +1 -1
- data/vendor/nginx/src/mail/ngx_mail_core_module.c +60 -34
- data/vendor/nginx/src/mail/ngx_mail_handler.c +17 -12
- data/vendor/nginx/src/mail/ngx_mail_proxy_module.c +1 -14
- data/vendor/nginx/src/mail/ngx_mail_smtp_handler.c +1 -1
- data/vendor/nginx/src/mail/ngx_mail_ssl_module.c +5 -5
- data/vendor/nginx/src/os/unix/ngx_atomic.h +10 -10
- data/vendor/nginx/src/os/unix/ngx_channel.h +4 -4
- data/vendor/nginx/src/os/unix/ngx_darwin_config.h +2 -0
- data/vendor/nginx/src/os/unix/ngx_darwin_init.c +1 -0
- data/vendor/nginx/src/os/unix/ngx_dlopen.c +28 -0
- data/vendor/nginx/src/os/unix/ngx_dlopen.h +31 -0
- data/vendor/nginx/src/os/unix/ngx_errno.h +1 -0
- data/vendor/nginx/src/os/unix/ngx_file_aio_read.c +1 -1
- data/vendor/nginx/src/os/unix/ngx_files.c +313 -80
- data/vendor/nginx/src/os/unix/ngx_files.h +5 -2
- data/vendor/nginx/src/os/unix/ngx_freebsd_config.h +3 -1
- data/vendor/nginx/src/os/unix/ngx_freebsd_init.c +1 -0
- data/vendor/nginx/src/os/unix/ngx_freebsd_sendfile_chain.c +13 -0
- data/vendor/nginx/src/os/unix/ngx_linux.h +0 -2
- data/vendor/nginx/src/os/unix/ngx_linux_aio_read.c +1 -1
- data/vendor/nginx/src/os/unix/ngx_linux_config.h +2 -6
- data/vendor/nginx/src/os/unix/ngx_linux_init.c +1 -33
- data/vendor/nginx/src/os/unix/ngx_linux_sendfile_chain.c +55 -12
- data/vendor/nginx/src/os/unix/ngx_os.h +3 -9
- data/vendor/nginx/src/os/unix/ngx_posix_config.h +14 -1
- data/vendor/nginx/src/os/unix/ngx_posix_init.c +2 -1
- data/vendor/nginx/src/os/unix/ngx_process.c +1 -1
- data/vendor/nginx/src/os/unix/ngx_process_cycle.c +25 -51
- data/vendor/nginx/src/os/unix/ngx_process_cycle.h +1 -0
- data/vendor/nginx/src/os/unix/ngx_readv_chain.c +24 -28
- data/vendor/nginx/src/os/unix/ngx_recv.c +30 -79
- data/vendor/nginx/src/os/unix/ngx_send.c +1 -1
- data/vendor/nginx/src/os/unix/ngx_setaffinity.c +14 -30
- data/vendor/nginx/src/os/unix/ngx_setaffinity.h +15 -1
- data/vendor/nginx/src/os/unix/ngx_solaris_config.h +2 -0
- data/vendor/nginx/src/os/unix/ngx_solaris_init.c +1 -0
- data/vendor/nginx/src/os/unix/ngx_solaris_sendfilev_chain.c +23 -0
- data/vendor/nginx/src/os/unix/ngx_sunpro_amd64.il +3 -3
- data/vendor/nginx/src/os/unix/ngx_sunpro_x86.il +3 -3
- data/vendor/nginx/src/os/unix/ngx_udp_recv.c +5 -48
- data/vendor/nginx/src/os/unix/ngx_udp_send.c +56 -0
- data/vendor/nginx/src/stream/ngx_stream.c +564 -0
- data/vendor/nginx/src/stream/ngx_stream.h +212 -0
- data/vendor/nginx/src/stream/ngx_stream_access_module.c +451 -0
- data/vendor/nginx/src/stream/ngx_stream_core_module.c +562 -0
- data/vendor/nginx/src/stream/ngx_stream_handler.c +344 -0
- data/vendor/nginx/src/stream/ngx_stream_limit_conn_module.c +632 -0
- data/vendor/nginx/src/stream/ngx_stream_proxy_module.c +1674 -0
- data/vendor/nginx/src/stream/ngx_stream_ssl_module.c +460 -0
- data/vendor/nginx/src/stream/ngx_stream_ssl_module.h +49 -0
- data/vendor/nginx/src/stream/ngx_stream_upstream.c +464 -0
- data/vendor/nginx/src/stream/ngx_stream_upstream.h +107 -0
- data/vendor/nginx/src/stream/ngx_stream_upstream_hash_module.c +656 -0
- data/vendor/nginx/src/stream/ngx_stream_upstream_least_conn_module.c +307 -0
- data/vendor/nginx/src/stream/ngx_stream_upstream_round_robin.c +702 -0
- data/vendor/nginx/src/stream/ngx_stream_upstream_round_robin.h +139 -0
- data/vendor/nginx/src/stream/ngx_stream_upstream_zone_module.c +242 -0
- metadata +39 -15
- data/vendor/nginx/src/event/modules/ngx_aio_module.c +0 -171
- data/vendor/nginx/src/event/modules/ngx_rtsig_module.c +0 -735
- data/vendor/nginx/src/http/ngx_http_spdy.c +0 -3701
- data/vendor/nginx/src/http/ngx_http_spdy.h +0 -261
- data/vendor/nginx/src/http/ngx_http_spdy_filter_module.c +0 -1222
- data/vendor/nginx/src/http/ngx_http_spdy_module.c +0 -408
- data/vendor/nginx/src/os/unix/ngx_aio_read.c +0 -109
- data/vendor/nginx/src/os/unix/ngx_aio_read_chain.c +0 -78
- data/vendor/nginx/src/os/unix/ngx_aio_write.c +0 -109
- data/vendor/nginx/src/os/unix/ngx_aio_write_chain.c +0 -100
@@ -1,408 +0,0 @@
|
|
1
|
-
|
2
|
-
/*
|
3
|
-
* Copyright (C) Nginx, Inc.
|
4
|
-
* Copyright (C) Valentin V. Bartenev
|
5
|
-
*/
|
6
|
-
|
7
|
-
|
8
|
-
#include <ngx_config.h>
|
9
|
-
#include <ngx_core.h>
|
10
|
-
#include <ngx_http.h>
|
11
|
-
#include <ngx_http_spdy_module.h>
|
12
|
-
|
13
|
-
|
14
|
-
static ngx_int_t ngx_http_spdy_add_variables(ngx_conf_t *cf);
|
15
|
-
|
16
|
-
static ngx_int_t ngx_http_spdy_variable(ngx_http_request_t *r,
|
17
|
-
ngx_http_variable_value_t *v, uintptr_t data);
|
18
|
-
static ngx_int_t ngx_http_spdy_request_priority_variable(ngx_http_request_t *r,
|
19
|
-
ngx_http_variable_value_t *v, uintptr_t data);
|
20
|
-
|
21
|
-
static ngx_int_t ngx_http_spdy_module_init(ngx_cycle_t *cycle);
|
22
|
-
|
23
|
-
static void *ngx_http_spdy_create_main_conf(ngx_conf_t *cf);
|
24
|
-
static char *ngx_http_spdy_init_main_conf(ngx_conf_t *cf, void *conf);
|
25
|
-
static void *ngx_http_spdy_create_srv_conf(ngx_conf_t *cf);
|
26
|
-
static char *ngx_http_spdy_merge_srv_conf(ngx_conf_t *cf, void *parent,
|
27
|
-
void *child);
|
28
|
-
static void *ngx_http_spdy_create_loc_conf(ngx_conf_t *cf);
|
29
|
-
static char *ngx_http_spdy_merge_loc_conf(ngx_conf_t *cf, void *parent,
|
30
|
-
void *child);
|
31
|
-
|
32
|
-
static char *ngx_http_spdy_recv_buffer_size(ngx_conf_t *cf, void *post,
|
33
|
-
void *data);
|
34
|
-
static char *ngx_http_spdy_pool_size(ngx_conf_t *cf, void *post, void *data);
|
35
|
-
static char *ngx_http_spdy_streams_index_mask(ngx_conf_t *cf, void *post,
|
36
|
-
void *data);
|
37
|
-
static char *ngx_http_spdy_chunk_size(ngx_conf_t *cf, void *post, void *data);
|
38
|
-
|
39
|
-
|
40
|
-
static ngx_conf_num_bounds_t ngx_http_spdy_headers_comp_bounds = {
|
41
|
-
ngx_conf_check_num_bounds, 0, 9
|
42
|
-
};
|
43
|
-
|
44
|
-
static ngx_conf_post_t ngx_http_spdy_recv_buffer_size_post =
|
45
|
-
{ ngx_http_spdy_recv_buffer_size };
|
46
|
-
static ngx_conf_post_t ngx_http_spdy_pool_size_post =
|
47
|
-
{ ngx_http_spdy_pool_size };
|
48
|
-
static ngx_conf_post_t ngx_http_spdy_streams_index_mask_post =
|
49
|
-
{ ngx_http_spdy_streams_index_mask };
|
50
|
-
static ngx_conf_post_t ngx_http_spdy_chunk_size_post =
|
51
|
-
{ ngx_http_spdy_chunk_size };
|
52
|
-
|
53
|
-
|
54
|
-
static ngx_command_t ngx_http_spdy_commands[] = {
|
55
|
-
|
56
|
-
{ ngx_string("spdy_recv_buffer_size"),
|
57
|
-
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
|
58
|
-
ngx_conf_set_size_slot,
|
59
|
-
NGX_HTTP_MAIN_CONF_OFFSET,
|
60
|
-
offsetof(ngx_http_spdy_main_conf_t, recv_buffer_size),
|
61
|
-
&ngx_http_spdy_recv_buffer_size_post },
|
62
|
-
|
63
|
-
{ ngx_string("spdy_pool_size"),
|
64
|
-
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
65
|
-
ngx_conf_set_size_slot,
|
66
|
-
NGX_HTTP_SRV_CONF_OFFSET,
|
67
|
-
offsetof(ngx_http_spdy_srv_conf_t, pool_size),
|
68
|
-
&ngx_http_spdy_pool_size_post },
|
69
|
-
|
70
|
-
{ ngx_string("spdy_max_concurrent_streams"),
|
71
|
-
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
72
|
-
ngx_conf_set_num_slot,
|
73
|
-
NGX_HTTP_SRV_CONF_OFFSET,
|
74
|
-
offsetof(ngx_http_spdy_srv_conf_t, concurrent_streams),
|
75
|
-
NULL },
|
76
|
-
|
77
|
-
{ ngx_string("spdy_streams_index_size"),
|
78
|
-
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
79
|
-
ngx_conf_set_num_slot,
|
80
|
-
NGX_HTTP_SRV_CONF_OFFSET,
|
81
|
-
offsetof(ngx_http_spdy_srv_conf_t, streams_index_mask),
|
82
|
-
&ngx_http_spdy_streams_index_mask_post },
|
83
|
-
|
84
|
-
{ ngx_string("spdy_recv_timeout"),
|
85
|
-
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
86
|
-
ngx_conf_set_msec_slot,
|
87
|
-
NGX_HTTP_SRV_CONF_OFFSET,
|
88
|
-
offsetof(ngx_http_spdy_srv_conf_t, recv_timeout),
|
89
|
-
NULL },
|
90
|
-
|
91
|
-
{ ngx_string("spdy_keepalive_timeout"),
|
92
|
-
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
93
|
-
ngx_conf_set_msec_slot,
|
94
|
-
NGX_HTTP_SRV_CONF_OFFSET,
|
95
|
-
offsetof(ngx_http_spdy_srv_conf_t, keepalive_timeout),
|
96
|
-
NULL },
|
97
|
-
|
98
|
-
{ ngx_string("spdy_headers_comp"),
|
99
|
-
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
|
100
|
-
ngx_conf_set_num_slot,
|
101
|
-
NGX_HTTP_SRV_CONF_OFFSET,
|
102
|
-
offsetof(ngx_http_spdy_srv_conf_t, headers_comp),
|
103
|
-
&ngx_http_spdy_headers_comp_bounds },
|
104
|
-
|
105
|
-
{ ngx_string("spdy_chunk_size"),
|
106
|
-
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
|
107
|
-
ngx_conf_set_size_slot,
|
108
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
109
|
-
offsetof(ngx_http_spdy_loc_conf_t, chunk_size),
|
110
|
-
&ngx_http_spdy_chunk_size_post },
|
111
|
-
|
112
|
-
ngx_null_command
|
113
|
-
};
|
114
|
-
|
115
|
-
|
116
|
-
static ngx_http_module_t ngx_http_spdy_module_ctx = {
|
117
|
-
ngx_http_spdy_add_variables, /* preconfiguration */
|
118
|
-
NULL, /* postconfiguration */
|
119
|
-
|
120
|
-
ngx_http_spdy_create_main_conf, /* create main configuration */
|
121
|
-
ngx_http_spdy_init_main_conf, /* init main configuration */
|
122
|
-
|
123
|
-
ngx_http_spdy_create_srv_conf, /* create server configuration */
|
124
|
-
ngx_http_spdy_merge_srv_conf, /* merge server configuration */
|
125
|
-
|
126
|
-
ngx_http_spdy_create_loc_conf, /* create location configuration */
|
127
|
-
ngx_http_spdy_merge_loc_conf /* merge location configuration */
|
128
|
-
};
|
129
|
-
|
130
|
-
|
131
|
-
ngx_module_t ngx_http_spdy_module = {
|
132
|
-
NGX_MODULE_V1,
|
133
|
-
&ngx_http_spdy_module_ctx, /* module context */
|
134
|
-
ngx_http_spdy_commands, /* module directives */
|
135
|
-
NGX_HTTP_MODULE, /* module type */
|
136
|
-
NULL, /* init master */
|
137
|
-
ngx_http_spdy_module_init, /* init module */
|
138
|
-
NULL, /* init process */
|
139
|
-
NULL, /* init thread */
|
140
|
-
NULL, /* exit thread */
|
141
|
-
NULL, /* exit process */
|
142
|
-
NULL, /* exit master */
|
143
|
-
NGX_MODULE_V1_PADDING
|
144
|
-
};
|
145
|
-
|
146
|
-
|
147
|
-
static ngx_http_variable_t ngx_http_spdy_vars[] = {
|
148
|
-
|
149
|
-
{ ngx_string("spdy"), NULL,
|
150
|
-
ngx_http_spdy_variable, 0, 0, 0 },
|
151
|
-
|
152
|
-
{ ngx_string("spdy_request_priority"), NULL,
|
153
|
-
ngx_http_spdy_request_priority_variable, 0, 0, 0 },
|
154
|
-
|
155
|
-
{ ngx_null_string, NULL, NULL, 0, 0, 0 }
|
156
|
-
};
|
157
|
-
|
158
|
-
|
159
|
-
static ngx_int_t
|
160
|
-
ngx_http_spdy_add_variables(ngx_conf_t *cf)
|
161
|
-
{
|
162
|
-
ngx_http_variable_t *var, *v;
|
163
|
-
|
164
|
-
for (v = ngx_http_spdy_vars; v->name.len; v++) {
|
165
|
-
var = ngx_http_add_variable(cf, &v->name, v->flags);
|
166
|
-
if (var == NULL) {
|
167
|
-
return NGX_ERROR;
|
168
|
-
}
|
169
|
-
|
170
|
-
var->get_handler = v->get_handler;
|
171
|
-
var->data = v->data;
|
172
|
-
}
|
173
|
-
|
174
|
-
return NGX_OK;
|
175
|
-
}
|
176
|
-
|
177
|
-
|
178
|
-
static ngx_int_t
|
179
|
-
ngx_http_spdy_variable(ngx_http_request_t *r,
|
180
|
-
ngx_http_variable_value_t *v, uintptr_t data)
|
181
|
-
{
|
182
|
-
if (r->spdy_stream) {
|
183
|
-
v->len = sizeof("3.1") - 1;
|
184
|
-
v->valid = 1;
|
185
|
-
v->no_cacheable = 0;
|
186
|
-
v->not_found = 0;
|
187
|
-
v->data = (u_char *) "3.1";
|
188
|
-
|
189
|
-
return NGX_OK;
|
190
|
-
}
|
191
|
-
|
192
|
-
*v = ngx_http_variable_null_value;
|
193
|
-
|
194
|
-
return NGX_OK;
|
195
|
-
}
|
196
|
-
|
197
|
-
|
198
|
-
static ngx_int_t
|
199
|
-
ngx_http_spdy_request_priority_variable(ngx_http_request_t *r,
|
200
|
-
ngx_http_variable_value_t *v, uintptr_t data)
|
201
|
-
{
|
202
|
-
if (r->spdy_stream) {
|
203
|
-
v->len = 1;
|
204
|
-
v->valid = 1;
|
205
|
-
v->no_cacheable = 0;
|
206
|
-
v->not_found = 0;
|
207
|
-
|
208
|
-
v->data = ngx_pnalloc(r->pool, 1);
|
209
|
-
if (v->data == NULL) {
|
210
|
-
return NGX_ERROR;
|
211
|
-
}
|
212
|
-
|
213
|
-
v->data[0] = '0' + (u_char) r->spdy_stream->priority;
|
214
|
-
|
215
|
-
return NGX_OK;
|
216
|
-
}
|
217
|
-
|
218
|
-
*v = ngx_http_variable_null_value;
|
219
|
-
|
220
|
-
return NGX_OK;
|
221
|
-
}
|
222
|
-
|
223
|
-
|
224
|
-
static ngx_int_t
|
225
|
-
ngx_http_spdy_module_init(ngx_cycle_t *cycle)
|
226
|
-
{
|
227
|
-
ngx_http_spdy_request_headers_init();
|
228
|
-
|
229
|
-
return NGX_OK;
|
230
|
-
}
|
231
|
-
|
232
|
-
|
233
|
-
static void *
|
234
|
-
ngx_http_spdy_create_main_conf(ngx_conf_t *cf)
|
235
|
-
{
|
236
|
-
ngx_http_spdy_main_conf_t *smcf;
|
237
|
-
|
238
|
-
smcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_spdy_main_conf_t));
|
239
|
-
if (smcf == NULL) {
|
240
|
-
return NULL;
|
241
|
-
}
|
242
|
-
|
243
|
-
smcf->recv_buffer_size = NGX_CONF_UNSET_SIZE;
|
244
|
-
|
245
|
-
return smcf;
|
246
|
-
}
|
247
|
-
|
248
|
-
|
249
|
-
static char *
|
250
|
-
ngx_http_spdy_init_main_conf(ngx_conf_t *cf, void *conf)
|
251
|
-
{
|
252
|
-
ngx_http_spdy_main_conf_t *smcf = conf;
|
253
|
-
|
254
|
-
ngx_conf_init_size_value(smcf->recv_buffer_size, 256 * 1024);
|
255
|
-
|
256
|
-
return NGX_CONF_OK;
|
257
|
-
}
|
258
|
-
|
259
|
-
|
260
|
-
static void *
|
261
|
-
ngx_http_spdy_create_srv_conf(ngx_conf_t *cf)
|
262
|
-
{
|
263
|
-
ngx_http_spdy_srv_conf_t *sscf;
|
264
|
-
|
265
|
-
sscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_spdy_srv_conf_t));
|
266
|
-
if (sscf == NULL) {
|
267
|
-
return NULL;
|
268
|
-
}
|
269
|
-
|
270
|
-
sscf->pool_size = NGX_CONF_UNSET_SIZE;
|
271
|
-
|
272
|
-
sscf->concurrent_streams = NGX_CONF_UNSET_UINT;
|
273
|
-
sscf->streams_index_mask = NGX_CONF_UNSET_UINT;
|
274
|
-
|
275
|
-
sscf->recv_timeout = NGX_CONF_UNSET_MSEC;
|
276
|
-
sscf->keepalive_timeout = NGX_CONF_UNSET_MSEC;
|
277
|
-
|
278
|
-
sscf->headers_comp = NGX_CONF_UNSET;
|
279
|
-
|
280
|
-
return sscf;
|
281
|
-
}
|
282
|
-
|
283
|
-
|
284
|
-
static char *
|
285
|
-
ngx_http_spdy_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
|
286
|
-
{
|
287
|
-
ngx_http_spdy_srv_conf_t *prev = parent;
|
288
|
-
ngx_http_spdy_srv_conf_t *conf = child;
|
289
|
-
|
290
|
-
ngx_conf_merge_size_value(conf->pool_size, prev->pool_size, 4096);
|
291
|
-
|
292
|
-
ngx_conf_merge_uint_value(conf->concurrent_streams,
|
293
|
-
prev->concurrent_streams, 100);
|
294
|
-
|
295
|
-
ngx_conf_merge_uint_value(conf->streams_index_mask,
|
296
|
-
prev->streams_index_mask, 32 - 1);
|
297
|
-
|
298
|
-
ngx_conf_merge_msec_value(conf->recv_timeout,
|
299
|
-
prev->recv_timeout, 30000);
|
300
|
-
ngx_conf_merge_msec_value(conf->keepalive_timeout,
|
301
|
-
prev->keepalive_timeout, 180000);
|
302
|
-
|
303
|
-
ngx_conf_merge_value(conf->headers_comp, prev->headers_comp, 0);
|
304
|
-
|
305
|
-
return NGX_CONF_OK;
|
306
|
-
}
|
307
|
-
|
308
|
-
|
309
|
-
static void *
|
310
|
-
ngx_http_spdy_create_loc_conf(ngx_conf_t *cf)
|
311
|
-
{
|
312
|
-
ngx_http_spdy_loc_conf_t *slcf;
|
313
|
-
|
314
|
-
slcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_spdy_loc_conf_t));
|
315
|
-
if (slcf == NULL) {
|
316
|
-
return NULL;
|
317
|
-
}
|
318
|
-
|
319
|
-
slcf->chunk_size = NGX_CONF_UNSET_SIZE;
|
320
|
-
|
321
|
-
return slcf;
|
322
|
-
}
|
323
|
-
|
324
|
-
|
325
|
-
static char *
|
326
|
-
ngx_http_spdy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|
327
|
-
{
|
328
|
-
ngx_http_spdy_loc_conf_t *prev = parent;
|
329
|
-
ngx_http_spdy_loc_conf_t *conf = child;
|
330
|
-
|
331
|
-
ngx_conf_merge_size_value(conf->chunk_size, prev->chunk_size, 8 * 1024);
|
332
|
-
|
333
|
-
return NGX_CONF_OK;
|
334
|
-
}
|
335
|
-
|
336
|
-
|
337
|
-
static char *
|
338
|
-
ngx_http_spdy_recv_buffer_size(ngx_conf_t *cf, void *post, void *data)
|
339
|
-
{
|
340
|
-
size_t *sp = data;
|
341
|
-
|
342
|
-
if (*sp <= 2 * NGX_SPDY_STATE_BUFFER_SIZE) {
|
343
|
-
return "value is too small";
|
344
|
-
}
|
345
|
-
|
346
|
-
return NGX_CONF_OK;
|
347
|
-
}
|
348
|
-
|
349
|
-
|
350
|
-
static char *
|
351
|
-
ngx_http_spdy_pool_size(ngx_conf_t *cf, void *post, void *data)
|
352
|
-
{
|
353
|
-
size_t *sp = data;
|
354
|
-
|
355
|
-
if (*sp < NGX_MIN_POOL_SIZE) {
|
356
|
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
357
|
-
"the pool size must be no less than %uz",
|
358
|
-
NGX_MIN_POOL_SIZE);
|
359
|
-
return NGX_CONF_ERROR;
|
360
|
-
}
|
361
|
-
|
362
|
-
if (*sp % NGX_POOL_ALIGNMENT) {
|
363
|
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
364
|
-
"the pool size must be a multiple of %uz",
|
365
|
-
NGX_POOL_ALIGNMENT);
|
366
|
-
return NGX_CONF_ERROR;
|
367
|
-
}
|
368
|
-
|
369
|
-
return NGX_CONF_OK;
|
370
|
-
}
|
371
|
-
|
372
|
-
|
373
|
-
static char *
|
374
|
-
ngx_http_spdy_streams_index_mask(ngx_conf_t *cf, void *post, void *data)
|
375
|
-
{
|
376
|
-
ngx_uint_t *np = data;
|
377
|
-
|
378
|
-
ngx_uint_t mask;
|
379
|
-
|
380
|
-
mask = *np - 1;
|
381
|
-
|
382
|
-
if (*np == 0 || (*np & mask)) {
|
383
|
-
return "must be a power of two";
|
384
|
-
}
|
385
|
-
|
386
|
-
*np = mask;
|
387
|
-
|
388
|
-
return NGX_CONF_OK;
|
389
|
-
}
|
390
|
-
|
391
|
-
|
392
|
-
static char *
|
393
|
-
ngx_http_spdy_chunk_size(ngx_conf_t *cf, void *post, void *data)
|
394
|
-
{
|
395
|
-
size_t *sp = data;
|
396
|
-
|
397
|
-
if (*sp == 0) {
|
398
|
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
399
|
-
"the spdy chunk size cannot be zero");
|
400
|
-
return NGX_CONF_ERROR;
|
401
|
-
}
|
402
|
-
|
403
|
-
if (*sp > NGX_SPDY_MAX_FRAME_SIZE) {
|
404
|
-
*sp = NGX_SPDY_MAX_FRAME_SIZE;
|
405
|
-
}
|
406
|
-
|
407
|
-
return NGX_CONF_OK;
|
408
|
-
}
|
@@ -1,109 +0,0 @@
|
|
1
|
-
|
2
|
-
/*
|
3
|
-
* Copyright (C) Igor Sysoev
|
4
|
-
* Copyright (C) Nginx, Inc.
|
5
|
-
*/
|
6
|
-
|
7
|
-
|
8
|
-
#include <ngx_config.h>
|
9
|
-
#include <ngx_core.h>
|
10
|
-
#include <ngx_event.h>
|
11
|
-
|
12
|
-
|
13
|
-
extern int ngx_kqueue;
|
14
|
-
|
15
|
-
|
16
|
-
ssize_t
|
17
|
-
ngx_aio_read(ngx_connection_t *c, u_char *buf, size_t size)
|
18
|
-
{
|
19
|
-
int n;
|
20
|
-
ngx_event_t *rev;
|
21
|
-
|
22
|
-
rev = c->read;
|
23
|
-
|
24
|
-
if (!rev->ready) {
|
25
|
-
ngx_log_error(NGX_LOG_ALERT, c->log, 0, "second aio post");
|
26
|
-
return NGX_AGAIN;
|
27
|
-
}
|
28
|
-
|
29
|
-
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
|
30
|
-
"rev->complete: %d", rev->complete);
|
31
|
-
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
|
32
|
-
"aio size: %d", size);
|
33
|
-
|
34
|
-
if (!rev->complete) {
|
35
|
-
ngx_memzero(&rev->aiocb, sizeof(struct aiocb));
|
36
|
-
|
37
|
-
rev->aiocb.aio_fildes = c->fd;
|
38
|
-
rev->aiocb.aio_buf = buf;
|
39
|
-
rev->aiocb.aio_nbytes = size;
|
40
|
-
|
41
|
-
#if (NGX_HAVE_KQUEUE)
|
42
|
-
rev->aiocb.aio_sigevent.sigev_notify_kqueue = ngx_kqueue;
|
43
|
-
rev->aiocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
|
44
|
-
rev->aiocb.aio_sigevent.sigev_value.sigval_ptr = rev;
|
45
|
-
#endif
|
46
|
-
|
47
|
-
if (aio_read(&rev->aiocb) == -1) {
|
48
|
-
ngx_log_error(NGX_LOG_CRIT, rev->log, ngx_errno,
|
49
|
-
"aio_read() failed");
|
50
|
-
rev->error = 1;
|
51
|
-
return NGX_ERROR;
|
52
|
-
}
|
53
|
-
|
54
|
-
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
|
55
|
-
"aio_read: #%d OK", c->fd);
|
56
|
-
|
57
|
-
rev->active = 1;
|
58
|
-
rev->ready = 0;
|
59
|
-
}
|
60
|
-
|
61
|
-
rev->complete = 0;
|
62
|
-
|
63
|
-
n = aio_error(&rev->aiocb);
|
64
|
-
if (n == -1) {
|
65
|
-
ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno, "aio_error() failed");
|
66
|
-
rev->error = 1;
|
67
|
-
return NGX_ERROR;
|
68
|
-
}
|
69
|
-
|
70
|
-
if (n != 0) {
|
71
|
-
if (n == NGX_EINPROGRESS) {
|
72
|
-
if (rev->ready) {
|
73
|
-
ngx_log_error(NGX_LOG_ALERT, c->log, n,
|
74
|
-
"aio_read() still in progress");
|
75
|
-
rev->ready = 0;
|
76
|
-
}
|
77
|
-
return NGX_AGAIN;
|
78
|
-
}
|
79
|
-
|
80
|
-
ngx_log_error(NGX_LOG_CRIT, c->log, n, "aio_read() failed");
|
81
|
-
rev->error = 1;
|
82
|
-
rev->ready = 0;
|
83
|
-
return NGX_ERROR;
|
84
|
-
}
|
85
|
-
|
86
|
-
n = aio_return(&rev->aiocb);
|
87
|
-
if (n == -1) {
|
88
|
-
ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
|
89
|
-
"aio_return() failed");
|
90
|
-
|
91
|
-
rev->error = 1;
|
92
|
-
rev->ready = 0;
|
93
|
-
return NGX_ERROR;
|
94
|
-
}
|
95
|
-
|
96
|
-
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, rev->log, 0,
|
97
|
-
"aio_read: #%d %d", c->fd, n);
|
98
|
-
|
99
|
-
if (n == 0) {
|
100
|
-
rev->eof = 1;
|
101
|
-
rev->ready = 0;
|
102
|
-
} else {
|
103
|
-
rev->ready = 1;
|
104
|
-
}
|
105
|
-
|
106
|
-
rev->active = 0;
|
107
|
-
|
108
|
-
return n;
|
109
|
-
}
|