From b85d0d44b12a61a4e40d9c9d138a5164b8dd16d4 Mon Sep 17 00:00:00 2001 From: Mikhail Kirichenko Date: Mon, 26 Oct 2015 14:16:27 +0300 Subject: [PATCH] RB-9093: build nginx without graphite module patch --- graphite_module_v1_7_7.patch | 26 +++++++++++++------------- src/ngx_http_graphite_module.c | 7 ++++++- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/graphite_module_v1_7_7.patch b/graphite_module_v1_7_7.patch index 04bf8e8..3d99a32 100644 --- a/graphite_module_v1_7_7.patch +++ b/graphite_module_v1_7_7.patch @@ -1,8 +1,6 @@ -Only in b: Makefile -Only in b: objs diff -u -p -r a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c ---- a/src/event/ngx_event_openssl.c 2015-06-24 12:24:37.105614096 +0300 -+++ b/src/event/ngx_event_openssl.c 2015-06-24 12:24:40.714496163 +0300 +--- a/src/event/ngx_event_openssl.c 2014-10-28 18:04:48.000000000 +0300 ++++ b/src/event/ngx_event_openssl.c 2015-10-26 14:02:58.485592941 +0300 @@ -1028,6 +1028,16 @@ ngx_ssl_handshake(ngx_connection_t *c) ngx_ssl_clear_error(c->log); @@ -34,8 +32,8 @@ diff -u -p -r a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c c->send = ngx_ssl_write; c->recv_chain = ngx_ssl_recv_chain; diff -u -p -r a/src/event/ngx_event_openssl.h b/src/event/ngx_event_openssl.h ---- a/src/event/ngx_event_openssl.h 2015-06-24 12:24:37.104614090 +0300 -+++ b/src/event/ngx_event_openssl.h 2015-06-24 12:24:40.692496892 +0300 +--- a/src/event/ngx_event_openssl.h 2014-10-28 18:04:48.000000000 +0300 ++++ b/src/event/ngx_event_openssl.h 2015-10-26 14:02:58.486592902 +0300 @@ -56,6 +56,14 @@ typedef struct { ngx_event_handler_pt saved_read_handler; ngx_event_handler_pt saved_write_handler; @@ -52,8 +50,8 @@ diff -u -p -r a/src/event/ngx_event_openssl.h b/src/event/ngx_event_openssl.h unsigned renegotiation:1; unsigned buffer:1; diff -u -p -r a/src/http/modules/ngx_http_gzip_filter_module.c b/src/http/modules/ngx_http_gzip_filter_module.c ---- a/src/http/modules/ngx_http_gzip_filter_module.c 2015-06-24 12:24:37.109614125 +0300 -+++ b/src/http/modules/ngx_http_gzip_filter_module.c 2015-06-24 12:24:40.835492177 +0300 +--- a/src/http/modules/ngx_http_gzip_filter_module.c 2014-10-28 18:04:48.000000000 +0300 ++++ b/src/http/modules/ngx_http_gzip_filter_module.c 2015-10-26 14:02:58.486592902 +0300 @@ -365,6 +365,16 @@ ngx_http_gzip_body_filter(ngx_http_reque } } @@ -110,8 +108,8 @@ diff -u -p -r a/src/http/modules/ngx_http_gzip_filter_module.c b/src/http/module } diff -u -p -r a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c ---- a/src/http/ngx_http_core_module.c 2015-06-24 12:24:37.110614157 +0300 -+++ b/src/http/ngx_http_core_module.c 2015-06-24 12:24:40.847491782 +0300 +--- a/src/http/ngx_http_core_module.c 2014-10-28 18:04:48.000000000 +0300 ++++ b/src/http/ngx_http_core_module.c 2015-10-26 14:02:58.488592822 +0300 @@ -1404,7 +1404,19 @@ ngx_http_core_content_phase(ngx_http_req if (r->content_handler) { @@ -134,13 +132,15 @@ diff -u -p -r a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module. } diff -u -p -r a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h ---- a/src/http/ngx_http_request.h 2015-06-24 12:24:37.112614211 +0300 -+++ b/src/http/ngx_http_request.h 2015-06-24 12:24:40.895490195 +0300 -@@ -569,6 +569,21 @@ struct ngx_http_request_s { +--- a/src/http/ngx_http_request.h 2014-10-28 18:04:48.000000000 +0300 ++++ b/src/http/ngx_http_request.h 2015-10-26 14:03:34.458406927 +0300 +@@ -569,6 +569,23 @@ struct ngx_http_request_s { unsigned http_minor:16; unsigned http_major:16; + ++#define NGX_GRAPHITE_PATCH ++ +#if (NGX_GRAPHITE) + time_t content_start_sec; + ngx_msec_t content_start_msec; diff --git a/src/ngx_http_graphite_module.c b/src/ngx_http_graphite_module.c index b0d26ea..af02e85 100644 --- a/src/ngx_http_graphite_module.c +++ b/src/ngx_http_graphite_module.c @@ -1468,7 +1468,12 @@ ngx_http_graphite_param_content_time(ngx_http_request_t *r) { ngx_msec_int_t ms; + ms = 0; + +#if (defined(NGX_GRAPHITE_PATCH)) ms = (ngx_msec_int_t)((r->content_end_sec - r->content_start_sec) * 1000 + (r->content_end_msec - r->content_start_msec)); +#endif + ms = ngx_max(ms, 0); return (double)ms; @@ -1481,7 +1486,7 @@ ngx_http_graphite_param_gzip_time(ngx_http_request_t *r) { ms = 0; -#if (NGX_HTTP_GZIP) +#if (defined(NGX_GRAPHITE_PATCH) && (NGX_HTTP_GZIP)) ms = (ngx_msec_int_t)((r->gzip_end_sec - r->gzip_start_sec) * 1000 + (r->gzip_end_msec - r->gzip_start_msec)); #endif ms = ngx_max(ms, 0);