nginxtra 1.8.0.11 → 1.8.1.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,15 +51,11 @@ typedef void (*ngx_resolver_handler_pt)(ngx_resolver_ctx_t *ctx);
51
51
 
52
52
 
53
53
  typedef struct {
54
- /* PTR: resolved name, A: name to resolve */
55
- u_char *name;
56
-
54
+ ngx_rbtree_node_t node;
57
55
  ngx_queue_t queue;
58
56
 
59
- /* event ident must be after 3 pointers as in ngx_connection_t */
60
- ngx_int_t ident;
61
-
62
- ngx_rbtree_node_t node;
57
+ /* PTR: resolved name, A: name to resolve */
58
+ u_char *name;
63
59
 
64
60
  #if (NGX_HAVE_INET6)
65
61
  /* PTR: IPv6 address to resolve (IPv4 address is in rbtree node key) */
@@ -147,6 +143,9 @@ struct ngx_resolver_ctx_s {
147
143
  ngx_resolver_t *resolver;
148
144
  ngx_udp_connection_t *udp_connection;
149
145
 
146
+ /* event ident must be after 3 pointers as in ngx_connection_t */
147
+ ngx_int_t ident;
148
+
150
149
  ngx_int_t state;
151
150
  ngx_str_t name;
152
151
 
@@ -162,6 +161,8 @@ struct ngx_resolver_ctx_s {
162
161
  ngx_uint_t quick; /* unsigned quick:1; */
163
162
  ngx_uint_t recursion;
164
163
  ngx_event_t *event;
164
+
165
+ ngx_resolver_node_t *node;
165
166
  };
166
167
 
167
168
 
@@ -329,7 +329,7 @@ ngx_epoll_init(ngx_cycle_t *cycle, ngx_msec_t timer)
329
329
 
330
330
  #if (NGX_HAVE_EVENTFD)
331
331
  if (ngx_epoll_notify_init(cycle->log) != NGX_OK) {
332
- return NGX_ERROR;
332
+ ngx_epoll_module_ctx.actions.notify = NULL;
333
333
  }
334
334
  #endif
335
335
 
@@ -1038,6 +1038,8 @@ ngx_ssl_create_connection(ngx_ssl_t *ssl, ngx_connection_t *c, ngx_uint_t flags)
1038
1038
  sc->buffer = ((flags & NGX_SSL_BUFFER) != 0);
1039
1039
  sc->buffer_size = ssl->buffer_size;
1040
1040
 
1041
+ sc->session_ctx = ssl->ctx;
1042
+
1041
1043
  sc->connection = SSL_new(ssl->ctx);
1042
1044
 
1043
1045
  if (sc->connection == NULL) {
@@ -2303,7 +2305,7 @@ ngx_ssl_new_session(ngx_ssl_conn_t *ssl_conn, ngx_ssl_session_t *sess)
2303
2305
 
2304
2306
  c = ngx_ssl_get_connection(ssl_conn);
2305
2307
 
2306
- ssl_ctx = SSL_get_SSL_CTX(ssl_conn);
2308
+ ssl_ctx = c->ssl->session_ctx;
2307
2309
  shm_zone = SSL_CTX_get_ex_data(ssl_ctx, ngx_ssl_session_cache_index);
2308
2310
 
2309
2311
  cache = shm_zone->data;
@@ -2441,21 +2443,17 @@ ngx_ssl_get_cached_session(ngx_ssl_conn_t *ssl_conn, u_char *id, int len,
2441
2443
  ngx_ssl_sess_id_t *sess_id;
2442
2444
  ngx_ssl_session_cache_t *cache;
2443
2445
  u_char buf[NGX_SSL_MAX_SESSION_SIZE];
2444
- #if (NGX_DEBUG)
2445
2446
  ngx_connection_t *c;
2446
- #endif
2447
2447
 
2448
2448
  hash = ngx_crc32_short(id, (size_t) len);
2449
2449
  *copy = 0;
2450
2450
 
2451
- #if (NGX_DEBUG)
2452
2451
  c = ngx_ssl_get_connection(ssl_conn);
2453
2452
 
2454
2453
  ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
2455
2454
  "ssl get session: %08XD:%d", hash, len);
2456
- #endif
2457
2455
 
2458
- shm_zone = SSL_CTX_get_ex_data(SSL_get_SSL_CTX(ssl_conn),
2456
+ shm_zone = SSL_CTX_get_ex_data(c->ssl->session_ctx,
2459
2457
  ngx_ssl_session_cache_index);
2460
2458
 
2461
2459
  cache = shm_zone->data;
@@ -2834,13 +2832,14 @@ ngx_ssl_session_ticket_key_callback(ngx_ssl_conn_t *ssl_conn,
2834
2832
  SSL_CTX *ssl_ctx;
2835
2833
  ngx_uint_t i;
2836
2834
  ngx_array_t *keys;
2835
+ ngx_connection_t *c;
2837
2836
  ngx_ssl_session_ticket_key_t *key;
2838
2837
  #if (NGX_DEBUG)
2839
2838
  u_char buf[32];
2840
- ngx_connection_t *c;
2841
2839
  #endif
2842
2840
 
2843
- ssl_ctx = SSL_get_SSL_CTX(ssl_conn);
2841
+ c = ngx_ssl_get_connection(ssl_conn);
2842
+ ssl_ctx = c->ssl->session_ctx;
2844
2843
 
2845
2844
  keys = SSL_CTX_get_ex_data(ssl_ctx, ngx_ssl_session_ticket_keys_index);
2846
2845
  if (keys == NULL) {
@@ -2849,10 +2848,6 @@ ngx_ssl_session_ticket_key_callback(ngx_ssl_conn_t *ssl_conn,
2849
2848
 
2850
2849
  key = keys->elts;
2851
2850
 
2852
- #if (NGX_DEBUG)
2853
- c = ngx_ssl_get_connection(ssl_conn);
2854
- #endif
2855
-
2856
2851
  if (enc == 1) {
2857
2852
  /* encrypt session ticket */
2858
2853
 
@@ -46,6 +46,7 @@ typedef struct {
46
46
 
47
47
  typedef struct {
48
48
  ngx_ssl_conn_t *connection;
49
+ SSL_CTX *session_ctx;
49
50
 
50
51
  ngx_int_t last;
51
52
  ngx_buf_t *buf;
@@ -1220,7 +1220,7 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
1220
1220
  {
1221
1221
  u_char *p;
1222
1222
  size_t len, off;
1223
- ngx_uint_t i, default_server;
1223
+ ngx_uint_t i, default_server, proxy_protocol;
1224
1224
  struct sockaddr *sa;
1225
1225
  ngx_http_conf_addr_t *addr;
1226
1226
  #if (NGX_HAVE_UNIX_DOMAIN)
@@ -1281,6 +1281,8 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
1281
1281
  /* preserve default_server bit during listen options overwriting */
1282
1282
  default_server = addr[i].opt.default_server;
1283
1283
 
1284
+ proxy_protocol = lsopt->proxy_protocol || addr[i].opt.proxy_protocol;
1285
+
1284
1286
  #if (NGX_HTTP_SSL)
1285
1287
  ssl = lsopt->ssl || addr[i].opt.ssl;
1286
1288
  #endif
@@ -1314,6 +1316,7 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
1314
1316
  }
1315
1317
 
1316
1318
  addr[i].opt.default_server = default_server;
1319
+ addr[i].opt.proxy_protocol = proxy_protocol;
1317
1320
  #if (NGX_HTTP_SSL)
1318
1321
  addr[i].opt.ssl = ssl;
1319
1322
  #endif
@@ -1272,7 +1272,9 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r,
1272
1272
 
1273
1273
  *e.pos = '\0';
1274
1274
 
1275
- if (alias && ngx_strncmp(name, clcf->name.data, alias) == 0) {
1275
+ if (alias && alias != NGX_MAX_SIZE_T_VALUE
1276
+ && ngx_strncmp(name, r->uri.data, alias) == 0)
1277
+ {
1276
1278
  ngx_memmove(name, name + alias, len - alias);
1277
1279
  path.len -= alias;
1278
1280
  }
@@ -1355,6 +1357,8 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r,
1355
1357
  }
1356
1358
 
1357
1359
  } else {
1360
+ name = r->uri.data;
1361
+
1358
1362
  r->uri.len = alias + path.len;
1359
1363
  r->uri.data = ngx_pnalloc(r->pool, r->uri.len);
1360
1364
  if (r->uri.data == NULL) {
@@ -1362,8 +1366,8 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r,
1362
1366
  return NGX_OK;
1363
1367
  }
1364
1368
 
1365
- p = ngx_copy(r->uri.data, clcf->name.data, alias);
1366
- ngx_memcpy(p, name, path.len);
1369
+ p = ngx_copy(r->uri.data, name, alias);
1370
+ ngx_memcpy(p, path.data, path.len);
1367
1371
  }
1368
1372
 
1369
1373
  ngx_http_set_exten(r);
@@ -770,24 +770,32 @@ ngx_http_ssl_handshake_handler(ngx_connection_t *c)
770
770
  {
771
771
  unsigned int len;
772
772
  const unsigned char *data;
773
+ ngx_http_connection_t *hc;
773
774
  static const ngx_str_t spdy = ngx_string(NGX_SPDY_NPN_NEGOTIATED);
774
775
 
776
+ hc = c->data;
777
+
778
+ if (hc->addr_conf->spdy) {
779
+
775
780
  #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
776
- SSL_get0_alpn_selected(c->ssl->connection, &data, &len);
781
+ SSL_get0_alpn_selected(c->ssl->connection, &data, &len);
777
782
 
778
783
  #ifdef TLSEXT_TYPE_next_proto_neg
779
- if (len == 0) {
780
- SSL_get0_next_proto_negotiated(c->ssl->connection, &data, &len);
781
- }
784
+ if (len == 0) {
785
+ SSL_get0_next_proto_negotiated(c->ssl->connection, &data, &len);
786
+ }
782
787
  #endif
783
788
 
784
789
  #else /* TLSEXT_TYPE_next_proto_neg */
785
- SSL_get0_next_proto_negotiated(c->ssl->connection, &data, &len);
790
+ SSL_get0_next_proto_negotiated(c->ssl->connection, &data, &len);
786
791
  #endif
787
792
 
788
- if (len == spdy.len && ngx_strncmp(data, spdy.data, spdy.len) == 0) {
789
- ngx_http_spdy_init(c->read);
790
- return;
793
+ if (len == spdy.len
794
+ && ngx_strncmp(data, spdy.data, spdy.len) == 0)
795
+ {
796
+ ngx_http_spdy_init(c->read);
797
+ return;
798
+ }
791
799
  }
792
800
  }
793
801
  #endif
@@ -530,15 +530,24 @@ ngx_http_upstream_init_request(ngx_http_request_t *r)
530
530
 
531
531
  r->write_event_handler = ngx_http_request_empty_handler;
532
532
 
533
- if (rc == NGX_DONE) {
534
- return;
535
- }
536
-
537
533
  if (rc == NGX_ERROR) {
538
534
  ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
539
535
  return;
540
536
  }
541
537
 
538
+ if (rc == NGX_OK) {
539
+ rc = ngx_http_upstream_cache_send(r, u);
540
+
541
+ if (rc == NGX_DONE) {
542
+ return;
543
+ }
544
+
545
+ if (rc == NGX_HTTP_UPSTREAM_INVALID_HEADER) {
546
+ rc = NGX_DECLINED;
547
+ r->cached = 0;
548
+ }
549
+ }
550
+
542
551
  if (rc != NGX_DECLINED) {
543
552
  ngx_http_finalize_request(r, rc);
544
553
  return;
@@ -833,13 +842,7 @@ ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u)
833
842
 
834
843
  case NGX_OK:
835
844
 
836
- rc = ngx_http_upstream_cache_send(r, u);
837
-
838
- if (rc != NGX_HTTP_UPSTREAM_INVALID_HEADER) {
839
- return rc;
840
- }
841
-
842
- break;
845
+ return NGX_OK;
843
846
 
844
847
  case NGX_HTTP_CACHE_STALE:
845
848
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nginxtra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0.11
4
+ version: 1.8.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Virata-Stone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-15 00:00:00.000000000 Z
11
+ date: 2016-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -24,9 +24,65 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: nokogiri
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.38.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.38.0
27
83
  description: This gem is intended to provide an easy to use configuration file that
28
84
  will automatically be used to compile nginx and configure the configuration.
29
- email: reasonnumber@gmail.com
85
+ email: mike@virata-stone.com
30
86
  executables:
31
87
  - nginxtra
32
88
  - nginxtra_rails
@@ -422,7 +478,7 @@ files:
422
478
  - vendor/nginx/src/os/unix/ngx_user.c
423
479
  - vendor/nginx/src/os/unix/ngx_user.h
424
480
  - vendor/nginx/src/os/unix/ngx_writev_chain.c
425
- homepage: https://github.com/mikestone/nginxtra
481
+ homepage: https://github.com/smellsblue/nginxtra
426
482
  licenses:
427
483
  - nginx
428
484
  metadata: {}
@@ -442,7 +498,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
442
498
  version: '0'
443
499
  requirements: []
444
500
  rubyforge_project:
445
- rubygems_version: 2.4.8
501
+ rubygems_version: 2.5.1
446
502
  signing_key:
447
503
  specification_version: 4
448
504
  summary: Wrapper of nginx for easy install and use.