diff options
Diffstat (limited to 'www/nginx/files')
17 files changed, 410 insertions, 444 deletions
diff --git a/www/nginx/files/extra-patch-ngx_http_drizzle_upstream.c b/www/nginx/files/extra-patch-ngx_http_drizzle_upstream.c new file mode 100644 index 000000000000..614613c9ec8a --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_http_drizzle_upstream.c @@ -0,0 +1,17 @@ +--- ../drizzle-nginx-module-0.1.9/src/ngx_http_drizzle_upstream.c.orig 2016-11-20 15:32:37.264746000 -0500 ++++ ../drizzle-nginx-module-0.1.9/src/ngx_http_drizzle_upstream.c 2016-11-20 15:33:20.909836000 -0500 +@@ -1027,12 +1027,14 @@ + continue; + } + ++#if (nginx_version < 1011006) + if (uscfp[i]->default_port && url->default_port + && uscfp[i]->default_port != url->default_port) + { + dd("upstream_add: default_port not match"); + continue; + } ++#endif + + return uscfp[i]; + } diff --git a/www/nginx/files/extra-patch-ngx_http_echo_request_info.c b/www/nginx/files/extra-patch-ngx_http_echo_request_info.c new file mode 100644 index 000000000000..87b39d08a5db --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_http_echo_request_info.c @@ -0,0 +1,43 @@ +--- ../echo-nginx-module-46334b3/src/ngx_http_echo_request_info.c.orig 2017-04-15 10:03:29.616243000 -0400 ++++ ../echo-nginx-module-46334b3/src/ngx_http_echo_request_info.c 2017-04-15 10:07:41.329695000 -0400 +@@ -179,6 +179,9 @@ + ngx_int_t i, j; + ngx_buf_t *b, *first = NULL; + unsigned found; ++#if defined(nginx_version) && nginx_version >= 1011011 ++ ngx_chain_t *cl; ++#endif + ngx_connection_t *c; + ngx_http_request_t *mr; + ngx_http_connection_t *hc; +@@ -215,8 +218,15 @@ + + if (hc->nbusy) { + b = NULL; ++ ++#if defined(nginx_version) && nginx_version >= 1011011 ++ for (cl = hc->busy; cl; /* void */) { ++ b = cl->buf; ++ cl = cl->next; ++#else + for (i = 0; i < hc->nbusy; i++) { + b = hc->busy[i]; ++#endif + + if (first == NULL) { + if (mr->request_line.data >= b->pos +@@ -280,8 +290,14 @@ + } + + if (hc->nbusy) { ++#if defined(nginx_version) && nginx_version >= 1011011 ++ for (cl = hc->busy; cl; /* void */) { ++ b = cl->buf; ++ cl = cl->next; ++#else + for (i = 0; i < hc->nbusy; i++) { + b = hc->busy[i]; ++#endif + + if (!found) { + if (b != first) { diff --git a/www/nginx/files/extra-patch-ngx_http_lua_common.h b/www/nginx/files/extra-patch-ngx_http_lua_common.h new file mode 100644 index 000000000000..24d7960c2bb2 --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_http_lua_common.h @@ -0,0 +1,15 @@ +--- ../lua-nginx-module-0.10.8/src/ngx_http_lua_common.h.orig 2017-04-15 10:55:20.591680000 -0400 ++++ ../lua-nginx-module-0.10.8/src/ngx_http_lua_common.h 2017-04-15 10:55:50.449108000 -0400 +@@ -199,6 +199,12 @@ + of reqeusts */ + ngx_uint_t malloc_trim_req_count; + ++#if nginx_version >= 1011011 ++ /* the following 2 fields are only used by ngx.req.raw_headers() for now */ ++ ngx_buf_t **busy_buf_ptrs; ++ ngx_int_t busy_buf_ptr_count; ++#endif ++ + unsigned requires_header_filter:1; + unsigned requires_body_filter:1; + unsigned requires_capture_filter:1; diff --git a/www/nginx/files/extra-patch-ngx_http_lua_headers.c b/www/nginx/files/extra-patch-ngx_http_lua_headers.c new file mode 100644 index 000000000000..d21a6c159db5 --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_http_lua_headers.c @@ -0,0 +1,124 @@ +--- ../lua-nginx-module-0.10.8/src/ngx_http_lua_headers.c.orig 2017-04-15 10:57:48.875770000 -0400 ++++ ../lua-nginx-module-0.10.8/src/ngx_http_lua_headers.c 2017-04-15 11:02:00.492564000 -0400 +@@ -26,6 +26,9 @@ + static int ngx_http_lua_ngx_req_header_clear(lua_State *L); + static int ngx_http_lua_ngx_req_header_set(lua_State *L); + static int ngx_http_lua_ngx_resp_get_headers(lua_State *L); ++#if nginx_version >= 1011011 ++void ngx_http_lua_ngx_raw_header_cleanup(void *data); ++#endif + + + static int +@@ -77,6 +80,11 @@ + size_t size; + ngx_buf_t *b, *first = NULL; + ngx_int_t i, j; ++#if nginx_version >= 1011011 ++ ngx_buf_t **bb; ++ ngx_chain_t *cl; ++ ngx_http_lua_main_conf_t *lmcf; ++#endif + ngx_connection_t *c; + ngx_http_request_t *r, *mr; + ngx_http_connection_t *hc; +@@ -93,6 +101,10 @@ + return luaL_error(L, "no request object found"); + } + ++#if nginx_version >= 1011011 ++ lmcf = ngx_http_get_module_main_conf(r, ngx_http_lua_module); ++#endif ++ + ngx_http_lua_check_fake_request(L, r); + + mr = r->main; +@@ -109,8 +121,13 @@ + dd("hc->nbusy: %d", (int) hc->nbusy); + + if (hc->nbusy) { ++#if nginx_version >= 1011011 ++ dd("hc->busy: %p %p %p %p", hc->busy->buf->start, hc->busy->buf->pos, ++ hc->busy->buf->last, hc->busy->buf->end); ++#else + dd("hc->busy: %p %p %p %p", hc->busy[0]->start, hc->busy[0]->pos, + hc->busy[0]->last, hc->busy[0]->end); ++#endif + } + + dd("request line: %p %p", mr->request_line.data, +@@ -146,9 +163,37 @@ + dd("size: %d", (int) size); + + if (hc->nbusy) { ++#if nginx_version >= 1011011 ++ if (hc->nbusy > lmcf->busy_buf_ptr_count) { ++ if (lmcf->busy_buf_ptrs) { ++ ngx_free(lmcf->busy_buf_ptrs); ++ } ++ ++ lmcf->busy_buf_ptrs = ngx_alloc(hc->nbusy * sizeof(ngx_buf_t *), ++ r->connection->log); ++ ++ if (lmcf->busy_buf_ptrs == NULL) { ++ return luaL_error(L, "no memory"); ++ } ++ ++ lmcf->busy_buf_ptr_count = hc->nbusy; ++ } ++ ++ bb = lmcf->busy_buf_ptrs; ++ for (cl = hc->busy; cl; cl = cl->next) { ++ *bb++ = cl->buf; ++ } ++#endif + b = NULL; ++ ++#if nginx_version >= 1011011 ++ bb = lmcf->busy_buf_ptrs; ++ for (i = hc->nbusy; i > 0; i--) { ++ b = bb[i - 1]; ++#else + for (i = 0; i < hc->nbusy; i++) { + b = hc->busy[i]; ++#endif + + dd("busy buf: %d: [%.*s]", (int) i, (int) (b->pos - b->start), + b->start); +@@ -223,8 +268,15 @@ + } + + if (hc->nbusy) { ++ ++#if nginx_version >= 1011011 ++ bb = lmcf->busy_buf_ptrs; ++ for (i = hc->nbusy - 1; i >= 0; i--) { ++ b = bb[i]; ++#else + for (i = 0; i < hc->nbusy; i++) { + b = hc->busy[i]; ++#endif + + if (!found) { + if (b != first) { +@@ -1431,4 +1483,20 @@ + #endif /* NGX_LUA_NO_FFI_API */ + + ++#if nginx_version >= 1011011 ++void ++ngx_http_lua_ngx_raw_header_cleanup(void *data) ++{ ++ ngx_http_lua_main_conf_t *lmcf; ++ ++ lmcf = (ngx_http_lua_main_conf_t *) data; ++ ++ if (lmcf->busy_buf_ptrs) { ++ ngx_free(lmcf->busy_buf_ptrs); ++ lmcf->busy_buf_ptrs = NULL; ++ } ++} ++#endif ++ ++ + /* vi:set ft=c ts=4 sw=4 et fdm=marker: */ diff --git a/www/nginx/files/extra-patch-ngx_http_lua_headers.h b/www/nginx/files/extra-patch-ngx_http_lua_headers.h new file mode 100644 index 000000000000..6b71b075ec55 --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_http_lua_headers.h @@ -0,0 +1,12 @@ +--- ../lua-nginx-module-0.10.8/src/ngx_http_lua_headers.h.orig 2017-04-15 11:05:40.649209000 -0400 ++++ ../lua-nginx-module-0.10.8/src/ngx_http_lua_headers.h 2017-04-15 11:06:01.658936000 -0400 +@@ -15,6 +15,9 @@ + void ngx_http_lua_inject_resp_header_api(lua_State *L); + void ngx_http_lua_inject_req_header_api(lua_State *L); + void ngx_http_lua_create_headers_metatable(ngx_log_t *log, lua_State *L); ++#if nginx_version >= 1011011 ++void ngx_http_lua_ngx_raw_header_cleanup(void *data); ++#endif + + + #endif /* _NGX_HTTP_LUA_HEADERS_H_INCLUDED_ */ diff --git a/www/nginx/files/extra-patch-ngx_http_lua_module.c b/www/nginx/files/extra-patch-ngx_http_lua_module.c new file mode 100644 index 000000000000..ca35511d24e3 --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_http_lua_module.c @@ -0,0 +1,36 @@ +--- ../lua-nginx-module-0.10.8/src/ngx_http_lua_module.c.orig 2017-04-15 11:07:10.366543000 -0400 ++++ ../lua-nginx-module-0.10.8/src/ngx_http_lua_module.c 2017-04-15 11:08:25.640520000 -0400 +@@ -28,6 +28,7 @@ + #include "ngx_http_lua_ssl_certby.h" + #include "ngx_http_lua_ssl_session_storeby.h" + #include "ngx_http_lua_ssl_session_fetchby.h" ++#include "ngx_http_lua_headers.h" + + + static void *ngx_http_lua_create_main_conf(ngx_conf_t *cf); +@@ -624,7 +625,7 @@ + volatile ngx_cycle_t *saved_cycle; + ngx_http_core_main_conf_t *cmcf; + ngx_http_lua_main_conf_t *lmcf; +-#ifndef NGX_LUA_NO_FFI_API ++#if !defined(NGX_LUA_NO_FFI_API) || nginx_version >= 1011011 + ngx_pool_cleanup_t *cln; + #endif + +@@ -716,6 +717,16 @@ + cln->handler = ngx_http_lua_sema_mm_cleanup; + #endif + ++#if nginx_version >= 1011011 ++ cln = ngx_pool_cleanup_add(cf->pool, 0); ++ if (cln == NULL) { ++ return NGX_ERROR; ++ } ++ ++ cln->data = lmcf; ++ cln->handler = ngx_http_lua_ngx_raw_header_cleanup; ++#endif ++ + if (lmcf->lua == NULL) { + dd("initializing lua vm"); + diff --git a/www/nginx/files/extra-patch-ngx_http_memc_util.c b/www/nginx/files/extra-patch-ngx_http_memc_util.c new file mode 100644 index 000000000000..8537d72142cb --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_http_memc_util.c @@ -0,0 +1,17 @@ +--- ../memc-nginx-module-0.17/src/ngx_http_memc_util.c.orig 2016-11-20 14:54:02.640140000 -0500 ++++ ../memc-nginx-module-0.17/src/ngx_http_memc_util.c 2016-11-20 14:54:34.579764000 -0500 +@@ -141,12 +141,14 @@ + continue; + } + ++#if (nginx_version < 1011006) + if (uscfp[i]->default_port && url->default_port + && uscfp[i]->default_port != url->default_port) + { + dd("upstream_add: default_port not match"); + continue; + } ++#endif + + return uscfp[i]; + } diff --git a/www/nginx/files/extra-patch-ngx_http_modsecurity.c b/www/nginx/files/extra-patch-ngx_http_modsecurity.c new file mode 100644 index 000000000000..cc7849710eb8 --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_http_modsecurity.c @@ -0,0 +1,18 @@ +--- ../modsecurity-2.9.1/nginx/modsecurity/ngx_http_modsecurity.c.orig 2017-04-15 10:45:12.886736000 -0400 ++++ ../modsecurity-2.9.1/nginx/modsecurity/ngx_http_modsecurity.c 2017-04-15 10:45:59.921529000 -0400 +@@ -528,9 +528,15 @@ + + hc = r->http_connection; + ++#if defined(nginx_version) && nginx_version >= 1011011 ++ if (hc->free && size == cscf->large_client_header_buffers.size) { ++ ++ buf = hc->free->buf; ++#else + if (hc->nfree && size == cscf->large_client_header_buffers.size) { + + buf = hc->free[--hc->nfree]; ++#endif + + ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "ModSecurity: use http free large header buffer: %p %uz", diff --git a/www/nginx/files/extra-patch-ngx_http_redis2_util.c b/www/nginx/files/extra-patch-ngx_http_redis2_util.c new file mode 100644 index 000000000000..9e71d98e6409 --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_http_redis2_util.c @@ -0,0 +1,18 @@ +--- ../redis2-nginx-module-0.12/src/ngx_http_redis2_util.c.orig 2016-11-20 15:00:28.997903000 -0500 ++++ ../redis2-nginx-module-0.12/src/ngx_http_redis2_util.c 2016-11-20 15:00:44.173323000 -0500 +@@ -77,6 +77,7 @@ + continue; + } + ++#if (nginx_version < 1011006) + if (uscfp[i]->default_port + && url->default_port + && uscfp[i]->default_port != url->default_port) +@@ -84,6 +85,7 @@ + dd("upstream_add: default_port not match"); + continue; + } ++#endif + + return uscfp[i]; + } diff --git a/www/nginx/files/extra-patch-ngx_http_sticky_misc.c b/www/nginx/files/extra-patch-ngx_http_sticky_misc.c new file mode 100644 index 000000000000..098cc78cdf61 --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_http_sticky_misc.c @@ -0,0 +1,17 @@ +--- ../nginx-goodies-nginx-sticky-module-ng-08a395c66e42/ngx_http_sticky_misc.c.orig 2016-07-10 11:39:07.943834000 -0400 ++++ ../nginx-goodies-nginx-sticky-module-ng-08a395c66e42/ngx_http_sticky_misc.c 2016-07-10 11:43:05.601078000 -0400 +@@ -12,6 +12,14 @@ + + #include "ngx_http_sticky_misc.h" + ++#ifndef MD5_DIGEST_LENGTH ++ #define MD5_DIGEST_LENGTH 16 ++#endif ++#ifndef MD5_CBLOCK ++ #define MD5_CBLOCK 64 ++#endif ++ ++ + #ifndef ngx_str_set + #define ngx_str_set(str, text) (str)->len = sizeof(text) - 1; (str)->data = (u_char *) text + #endif diff --git a/www/nginx/files/extra-patch-ngx_http_udplog_module.c b/www/nginx/files/extra-patch-ngx_http_udplog_module.c deleted file mode 100644 index a97325abfa31..000000000000 --- a/www/nginx/files/extra-patch-ngx_http_udplog_module.c +++ /dev/null @@ -1,431 +0,0 @@ ---- ../nginx_udplog_module-1.0.0/ngx_http_udplog_module.c.orig 2010-01-05 20:20:35.000000000 +0100 -+++ ../nginx_udplog_module-1.0.0/ngx_http_udplog_module.c 2011-12-02 18:31:18.000000000 +0100 -@@ -1,4 +1,3 @@ -- - /* - * Copyright (C) 2010 Valery Kholodkov - * -@@ -45,6 +44,12 @@ - } ngx_http_log_fmt_t; - - typedef struct { -+ ngx_str_t value; -+ ngx_array_t *lengths; -+ ngx_array_t *values; -+} ngx_http_log_tag_template_t; -+ -+typedef struct { - ngx_array_t formats; /* array of ngx_http_log_fmt_t */ - ngx_uint_t combined_used; /* unsigned combined_used:1 */ - } ngx_http_log_main_conf_t; -@@ -64,8 +69,7 @@ - typedef struct { - ngx_udp_endpoint_t *endpoint; - ngx_http_log_fmt_t *format; -- ngx_uint_t facility; -- ngx_uint_t severity; -+ ngx_uint_t bare:1; - } ngx_http_udplog_t; - - typedef struct { -@@ -73,8 +77,11 @@ - } ngx_http_udplog_main_conf_t; - - typedef struct { -- ngx_array_t *logs; /* array of ngx_http_udplog_t */ -- unsigned off; -+ ngx_array_t *logs; /* array of ngx_http_udplog_t */ -+ unsigned off; -+ ngx_http_log_tag_template_t *tag; -+ ngx_uint_t facility; -+ ngx_uint_t severity; - } ngx_http_udplog_conf_t; - - ngx_int_t ngx_udp_connect(ngx_udp_connection_t *uc); -@@ -88,6 +95,8 @@ - void *child); - - static char *ngx_http_udplog_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -+static char *ngx_http_udplog_set_priority(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -+static char *ngx_http_udplog_set_tag(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); - - static ngx_int_t ngx_http_udplog_init(ngx_conf_t *cf); - -@@ -96,12 +105,26 @@ - - { ngx_string("access_udplog"), - NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF -- |NGX_HTTP_LMT_CONF|NGX_CONF_TAKE123, -+ |NGX_HTTP_LMT_CONF|NGX_CONF_TAKE1234, - ngx_http_udplog_set_log, - NGX_HTTP_LOC_CONF_OFFSET, - 0, - NULL }, - -+ { ngx_string("udplog_priority"), -+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12, -+ ngx_http_udplog_set_priority, -+ NGX_HTTP_LOC_CONF_OFFSET, -+ 0, -+ NULL }, -+ -+ { ngx_string("udplog_tag"), -+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, -+ ngx_http_udplog_set_tag, -+ NGX_HTTP_LOC_CONF_OFFSET, -+ offsetof(ngx_http_udplog_conf_t, tag), -+ NULL }, -+ - ngx_null_command - }; - -@@ -166,7 +189,7 @@ - { ngx_null_string, 0 } - }; - --static ngx_udplog_severity_t ngx_udplog_severity[] = { -+static ngx_udplog_severity_t ngx_udplog_severities[] = { - { ngx_string("emerg"), 0 }, - { ngx_string("alert"), 1 }, - { ngx_string("crit"), 2 }, -@@ -190,6 +213,7 @@ - u_char *line, *p; - size_t len; - ngx_uint_t i, l, pri; -+ ngx_str_t tag; - ngx_http_udplog_t *log; - ngx_http_log_op_t *op; - ngx_http_udplog_conf_t *ulcf; -@@ -205,12 +229,31 @@ - return NGX_OK; - } - -+ if(ulcf->tag != NULL) -+ { -+ if(ulcf->tag->lengths == NULL) { -+ tag = ulcf->tag->value; -+ } -+ else{ -+ if (ngx_http_script_run(r, &tag, ulcf->tag->lengths->elts, 0, ulcf->tag->values->elts) -+ == NULL) -+ { -+ return NGX_ERROR; -+ } -+ } -+ } -+ else { -+ tag.data = (u_char*)"nginx"; -+ tag.len = sizeof("nginx") - 1; -+ } -+ - time = ngx_time(); - ngx_gmtime(time, &tm); - - log = ulcf->logs->elts; -+ pri = ulcf->facility * 8 + ulcf->severity; -+ - for (l = 0; l < ulcf->logs->nelts; l++) { -- pri = log[l].facility * 8 + log[l].severity; - - if(pri > 255) { - pri = NGX_UDPLOG_FACILITY_LOCAL7 * 8 + NGX_UDPLOG_SEVERITY_INFO; -@@ -231,7 +274,8 @@ - } - } - -- len += sizeof("<255>") - 1 + sizeof("Jan 31 00:00:00") - 1 + 1 + ngx_cycle->hostname.len + 1; -+ len += sizeof("<255>") - 1 + sizeof("Jan 31 00:00:00") - 1 + 1 + ngx_cycle->hostname.len + 1 -+ + tag.len + 2; - - #if defined nginx_version && nginx_version >= 7003 - line = ngx_pnalloc(r->pool, len); -@@ -245,9 +289,12 @@ - /* - * BSD syslog message header (see RFC 3164) - */ -- p = ngx_sprintf(line, "<%ui>%s %2d %02d:%02d:%02d %V ", pri, months[tm.ngx_tm_mon - 1], tm.ngx_tm_mday, -- tm.ngx_tm_hour, tm.ngx_tm_min, tm.ngx_tm_sec, &ngx_cycle->hostname); -- -+ if(!log[l].bare){ -+ p = ngx_sprintf(line, "<%ui>%s %2d %02d:%02d:%02d %V %V: ", pri, months[tm.ngx_tm_mon - 1], tm.ngx_tm_mday, -+ tm.ngx_tm_hour, tm.ngx_tm_min, tm.ngx_tm_sec, &ngx_cycle->hostname, &tag); -+ }else{ -+ p = line; -+ } - for (i = 0; i < log[l].format->ops->nelts; i++) { - p = op[i].run(r, p, &op[i]); - } -@@ -280,10 +327,15 @@ - uc->sockaddr = endpoint->peer_addr.sockaddr; - uc->socklen = endpoint->peer_addr.socklen; - uc->server = endpoint->peer_addr.name; --#if defined nginx_version && nginx_version >= 7054 -+#if defined nginx_version && ( nginx_version >= 7054 && nginx_version < 8032 ) - uc->log = &cf->cycle->new_log; - #else - uc->log = cf->cycle->new_log; -+#if defined nginx_version && nginx_version >= 8032 -+ uc->log.handler = NULL; -+ uc->log.data = NULL; -+ uc->log.action = "logging"; -+#endif - #endif - - return NGX_OK; -@@ -320,6 +372,11 @@ - - if (uc->connection == NULL) { - if(ngx_udp_connect(uc) != NGX_OK) { -+ if(uc->connection != NULL) { -+ ngx_free_connection(uc->connection); -+ uc->connection = NULL; -+ } -+ - return NGX_ERROR; - } - -@@ -335,7 +392,11 @@ - } - - if ((size_t) n != (size_t) len) { -+#if defined nginx_version && nginx_version >= 8032 -+ ngx_log_error(NGX_LOG_CRIT, &uc->log, 0, "send() incomplete"); -+#else - ngx_log_error(NGX_LOG_CRIT, uc->log, 0, "send() incomplete"); -+#endif - return NGX_ERROR; - } - -@@ -364,6 +425,9 @@ - if (conf == NULL) { - return NGX_CONF_ERROR; - } -+ conf->off = 1; -+ conf->facility = NGX_CONF_UNSET_UINT; -+ conf->severity = NGX_CONF_UNSET_UINT; - - return conf; - } -@@ -374,37 +438,21 @@ - ngx_http_udplog_conf_t *prev = parent; - ngx_http_udplog_conf_t *conf = child; - -- ngx_http_udplog_t *log; -- ngx_http_log_fmt_t *fmt; -- ngx_http_log_main_conf_t *lmcf; -- -- if(conf->logs || conf->off) { -- return NGX_CONF_OK; -+ if(conf->tag == NULL) { -+ conf->tag = prev->tag; - } - -- conf->logs = prev->logs; -- conf->off = prev->off; -+ ngx_conf_merge_uint_value(conf->facility, -+ prev->facility, NGX_UDPLOG_FACILITY_LOCAL7); -+ ngx_conf_merge_uint_value(conf->severity, -+ prev->severity, NGX_UDPLOG_SEVERITY_INFO); - - if(conf->logs || conf->off) { - return NGX_CONF_OK; - } - -- conf->logs = ngx_array_create(cf->pool, 2, sizeof(ngx_http_udplog_t)); -- if(conf->logs == NULL) { -- return NGX_CONF_ERROR; -- } -- -- log = ngx_array_push(conf->logs); -- if(log == NULL) { -- return NGX_CONF_ERROR; -- } -- -- lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module); -- fmt = lmcf->formats.elts; -- -- /* the default "combined" format */ -- log->format = &fmt[0]; -- lmcf->combined_used = 1; -+ conf->logs = prev->logs; -+ conf->off = prev->off; - - return NGX_CONF_OK; - } -@@ -434,12 +482,6 @@ - return endpoint; - } - --static ngx_int_t --ngx_http_udplog_set_facility_and_severity(ngx_http_udplog_t *log, ngx_str_t *value) --{ -- return NGX_OK; --} -- - static char * - ngx_http_udplog_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) - { -@@ -458,6 +500,7 @@ - ulcf->off = 1; - return NGX_CONF_OK; - } -+ ulcf->off = 0; - - if (ulcf->logs == NULL) { - ulcf->logs = ngx_array_create(cf->pool, 2, sizeof(ngx_http_udplog_t)); -@@ -483,10 +526,11 @@ - - ngx_memzero(&u, sizeof(ngx_url_t)); - -- u.host = value[1]; -- u.port = 514; -+ u.url = value[1]; -+ u.default_port = 514; -+ u.no_resolve = 0; - -- if(ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) { -+ if(ngx_parse_url(cf->pool, &u) != NGX_OK) { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V: %s", &u.host, u.err); - return NGX_CONF_ERROR; - } -@@ -496,7 +540,7 @@ - if(log->endpoint == NULL) { - return NGX_CONF_ERROR; - } -- -+ log->bare = 0; - if (cf->args->nelts >= 3) { - name = value[2]; - -@@ -508,14 +552,18 @@ - name.data = (u_char *) "combined"; - lmcf->combined_used = 1; - } -- -+ if (cf->args->nelts >= 4) { -+ if (ngx_strcmp(value[3].data, "bare") == 0) { -+ log->bare = 1; -+ } -+ } - fmt = lmcf->formats.elts; - for (i = 0; i < lmcf->formats.nelts; i++) { - if (fmt[i].name.len == name.len - && ngx_strcasecmp(fmt[i].name.data, name.data) == 0) - { - log->format = &fmt[i]; -- goto facility; -+ goto done; - } - } - -@@ -523,12 +571,105 @@ - "unknown log format \"%V\"", &name); - return NGX_CONF_ERROR; - --facility: -- log->facility = NGX_UDPLOG_FACILITY_LOCAL7; -- log->severity = NGX_UDPLOG_SEVERITY_INFO; -+done: -+ -+ return NGX_CONF_OK; -+} -+ -+ -+static char * -+ngx_http_udplog_set_priority(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -+{ -+ ngx_http_udplog_conf_t *ulcf = conf; -+ ngx_str_t *value; -+ ngx_udplog_facility_t *f; -+ ngx_udplog_severity_t *s; -+ -+ value = cf->args->elts; -+ -+ f = ngx_udplog_facilities; -+ -+ while(f->name.data != NULL) { -+ if(ngx_strncmp(f->name.data, value[1].data, f->name.len) == 0) -+ break; -+ -+ f++; -+ } -+ -+ if(f->name.data != NULL) { -+ ulcf->facility = f->number; -+ } -+ else { -+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, -+ "unknown facility \"%V\"", &value[1]); -+ return NGX_CONF_ERROR; -+ } -+ -+ if (cf->args->nelts == 3) { -+ s = ngx_udplog_severities; -+ -+ while(s->name.data != NULL) { -+ if(ngx_strncmp(s->name.data, value[2].data, s->name.len) == 0) -+ break; -+ -+ s++; -+ } -+ -+ if(s->name.data != NULL) { -+ ulcf->severity = s->number; -+ } -+ else { -+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, -+ "unknown severity \"%V\"", &value[2]); -+ return NGX_CONF_ERROR; -+ } -+ } -+ -+ return NGX_CONF_OK; -+} -+ -+static char * -+ngx_http_udplog_set_tag(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -+{ -+ ngx_int_t n; -+ ngx_str_t *value; -+ ngx_http_script_compile_t sc; -+ ngx_http_log_tag_template_t **field, *h; -+ -+ field = (ngx_http_log_tag_template_t**) (((u_char*)conf) + cmd->offset); -+ -+ value = cf->args->elts; -+ -+ if (*field == NULL) { -+ *field = ngx_palloc(cf->pool, sizeof(ngx_http_log_tag_template_t)); -+ if (*field == NULL) { -+ return NGX_CONF_ERROR; -+ } -+ } -+ -+ h = *field; -+ -+ h->value = value[1]; -+ h->lengths = NULL; -+ h->values = NULL; -+ -+ /* -+ * Compile field name -+ */ -+ n = ngx_http_script_variables_count(&value[1]); -+ -+ if (n > 0) { -+ ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); -+ -+ sc.cf = cf; -+ sc.source = &value[1]; -+ sc.lengths = &h->lengths; -+ sc.values = &h->values; -+ sc.variables = n; -+ sc.complete_lengths = 1; -+ sc.complete_values = 1; - -- if(cf->args->nelts == 4) { -- if(ngx_http_udplog_set_facility_and_severity(log, &value[3]) != NGX_OK) { -+ if (ngx_http_script_compile(&sc) != NGX_OK) { - return NGX_CONF_ERROR; - } - } diff --git a/www/nginx/files/extra-patch-ngx_http_upstream_fair_module.c.n b/www/nginx/files/extra-patch-ngx_http_upstream_fair_module.c.n new file mode 100644 index 000000000000..648f056b8eb6 --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_http_upstream_fair_module.c.n @@ -0,0 +1,21 @@ +--- ../nginx_upstream_fair-20090923/ngx_http_upstream_fair_module.c.orig 2016-11-20 15:42:48.550372000 -0500 ++++ ../nginx_upstream_fair-20090923/ngx_http_upstream_fair_module.c 2016-11-20 15:45:24.507554000 -0500 +@@ -565,8 +565,7 @@ + + + /* an upstream implicitly defined by proxy_pass, etc. */ +- +- if (us->port == 0 && us->default_port == 0) { ++ if (us->port == 0) { + ngx_log_error(NGX_LOG_EMERG, cf->log, 0, + "no port in upstream \"%V\" in %s:%ui", + &us->host, us->file_name, us->line); +@@ -576,7 +575,7 @@ + ngx_memzero(&u, sizeof(ngx_url_t)); + + u.host = us->host; +- u.port = (in_port_t) (us->port ? us->port : us->default_port); ++ u.port = (in_port_t) us->port; + + if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) { + if (u.err) { diff --git a/www/nginx/files/extra-patch-ngx_inet_slab.c b/www/nginx/files/extra-patch-ngx_inet_slab.c new file mode 100644 index 000000000000..74855f083e11 --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_inet_slab.c @@ -0,0 +1,29 @@ +--- ../ngx_dynamic_upstream-0.1.3/src/ngx_inet_slab.c.orig 2016-05-25 19:27:27.204200000 -0400 ++++ ../ngx_dynamic_upstream-0.1.3/src/ngx_inet_slab.c 2016-05-25 19:28:07.177622000 -0400 +@@ -250,7 +250,7 @@ + return NGX_ERROR; + } + +- ngx_memcpy(sin, u->sockaddr, sizeof(struct sockaddr_in)); ++ ngx_memcpy(sin, &u->sockaddr, sizeof(struct sockaddr_in)); + + u->addrs[0].sockaddr = (struct sockaddr *) sin; + u->addrs[0].socklen = sizeof(struct sockaddr_in); +@@ -277,7 +277,7 @@ + + u->family = u->addrs[0].sockaddr->sa_family; + u->socklen = u->addrs[0].socklen; +- ngx_memcpy(u->sockaddr, u->addrs[0].sockaddr, u->addrs[0].socklen); ++ ngx_memcpy(&u->sockaddr, u->addrs[0].sockaddr, u->addrs[0].socklen); + + switch (u->family) { + +@@ -405,7 +405,7 @@ + return NGX_ERROR; + } + +- ngx_memcpy(sin6, u->sockaddr, sizeof(struct sockaddr_in6)); ++ ngx_memcpy(sin6, &u->sockaddr, sizeof(struct sockaddr_in6)); + + u->addrs[0].sockaddr = (struct sockaddr *) sin6; + u->addrs[0].socklen = sizeof(struct sockaddr_in6); diff --git a/www/nginx/files/extra-patch-ngx_postgres_module.c b/www/nginx/files/extra-patch-ngx_postgres_module.c new file mode 100644 index 000000000000..dd8e302d1fd4 --- /dev/null +++ b/www/nginx/files/extra-patch-ngx_postgres_module.c @@ -0,0 +1,17 @@ +--- ../ngx_postgres-1.0rc7/src/ngx_postgres_module.c.orig 2016-11-20 15:34:25.763542000 -0500 ++++ ../ngx_postgres-1.0rc7/src/ngx_postgres_module.c 2016-11-20 15:34:41.023867000 -0500 +@@ -1320,12 +1320,14 @@ + continue; + } + ++#if (nginx_version < 1011006) + if (uscfp[i]->default_port && url->default_port + && (uscfp[i]->default_port != url->default_port)) + { + dd("default_port doesn't match"); + continue; + } ++#endif + + dd("returning"); + return uscfp[i]; diff --git a/www/nginx/files/extra-patch-spnego-http-auth-nginx-module-config b/www/nginx/files/extra-patch-spnego-http-auth-nginx-module-config index 9ac1b629b398..5f8d7523c16e 100644 --- a/www/nginx/files/extra-patch-spnego-http-auth-nginx-module-config +++ b/www/nginx/files/extra-patch-spnego-http-auth-nginx-module-config @@ -1,8 +1,9 @@ ---- ../spnego-http-auth-nginx-module-c85a38c/config.orig 2015-06-13 20:49:15.590751000 +0300 -+++ ../spnego-http-auth-nginx-module-c85a38c/config 2015-06-13 20:49:31.024936000 +0300 -@@ -1,4 +1,4 @@ +--- ../spnego-http-auth-nginx-module-0c6ff3f/config.orig 2017-04-15 13:07:01.159506000 -0400 ++++ ../spnego-http-auth-nginx-module-0c6ff3f/config 2017-04-15 13:07:36.283398000 -0400 +@@ -1,5 +1,5 @@ ngx_addon_name=ngx_http_auth_spnego_module - HTTP_MODULES="$HTTP_MODULES ngx_http_auth_spnego_module" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_auth_spnego_module.c" --CORE_LIBS="$CORE_LIBS -lgssapi_krb5 -lkrb5 -lcom_err" -+CORE_LIBS="$CORE_LIBS %%GSSAPILIBS%% -lcom_err" +-ngx_feature_libs="-lgssapi_krb5 -lkrb5 -lcom_err" ++ngx_feature_libs="%%GSSAPILIBS%% -lcom_err" + + if uname -o | grep -q FreeBSD; then + ngx_feature_libs="$ngx_feature_libs -lgssapi" diff --git a/www/nginx/files/extra-patch-src-c-ngx_http_clojure_socket.c b/www/nginx/files/extra-patch-src-c-ngx_http_clojure_socket.c new file mode 100644 index 000000000000..9ed68350ee74 --- /dev/null +++ b/www/nginx/files/extra-patch-src-c-ngx_http_clojure_socket.c @@ -0,0 +1,11 @@ +--- ../nginx-clojure-0.4.4/src/c/ngx_http_clojure_socket.c.orig 2016-05-24 17:39:48.898351000 -0400 ++++ ../nginx-clojure-0.4.4/src/c/ngx_http_clojure_socket.c 2016-05-25 19:23:44.584704000 -0400 +@@ -317,7 +317,7 @@ + } + u->resolved->host.data = url->host.data; + u->resolved->host.len = url->host.len; +- ngx_http_clojure_socket_upstream_connect(u, (struct sockaddr *)url->sockaddr, url->socklen); ++ ngx_http_clojure_socket_upstream_connect(u, &url->sockaddr, url->socklen); + } + + static void ngx_http_clojure_socket_upstream_connect_inner(ngx_http_clojure_socket_upstream_t *u) { diff --git a/www/nginx/files/extra-patch-src-http-ngx_http_upstream_round_robin.h b/www/nginx/files/extra-patch-src-http-ngx_http_upstream_round_robin.h index 9f6d868ff171..84c99aaaed61 100644 --- a/www/nginx/files/extra-patch-src-http-ngx_http_upstream_round_robin.h +++ b/www/nginx/files/extra-patch-src-http-ngx_http_upstream_round_robin.h @@ -1,13 +1,14 @@ ---- src/http/ngx_http_upstream_round_robin.h.orig 2016-02-24 14:53:24 UTC -+++ src/http/ngx_http_upstream_round_robin.h -@@ -35,6 +35,10 @@ struct ngx_http_upstream_rr_peer_s { +--- src/http/ngx_http_upstream_round_robin.h.orig 2016-10-11 11:03:02.000000000 -0400 ++++ src/http/ngx_http_upstream_round_robin.h 2016-10-11 19:56:33.262307000 -0400 +@@ -35,6 +35,11 @@ + ngx_uint_t max_fails; time_t fail_timeout; - ++ +#if (NGX_HTTP_UPSTREAM_CHECK) + ngx_uint_t check_index; +#endif + - ngx_uint_t down; /* unsigned down:1; */ + ngx_msec_t slow_start; + ngx_msec_t start_time; - #if (NGX_HTTP_SSL) |