[PATCH] memcached_force_ranges for memcached upstream

Martin Mlynář nexus at smoula.net
Tue Apr 21 11:37:52 UTC 2015


# HG changeset patch
# User Martin Mlynář <nexus at smoula.net>
# Date 1429613281 -7200
#      Tue Apr 21 12:48:01 2015 +0200
# Node ID 4cb149154501fc638596ab51031f8b3b64da2a7f
# Parent  1bdfceda86a99a4dc99934181d2f9e2632003ca8
memcached_force_ranges for memcached upstream

Allow option force_ranges for memcached upstream

diff -r 1bdfceda86a9 -r 4cb149154501 src/http/modules/ngx_http_memcached_module.c
--- a/src/http/modules/ngx_http_memcached_module.c	Mon Apr 20 17:36:51 2015 +0300
+++ b/src/http/modules/ngx_http_memcached_module.c	Tue Apr 21 12:48:01 2015 +0200
@@ -95,6 +95,13 @@
       offsetof(ngx_http_memcached_loc_conf_t, upstream.read_timeout),
       NULL },
 
+    { ngx_string("memcached_force_ranges"),
+      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
+      ngx_conf_set_flag_slot,
+      NGX_HTTP_LOC_CONF_OFFSET,
+      offsetof(ngx_http_memcached_loc_conf_t, upstream.force_ranges),
+      NULL },
+
     { ngx_string("memcached_next_upstream"),
       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
       ngx_conf_set_bitmask_slot,
@@ -604,6 +611,7 @@
     conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
 
     conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
+    conf->upstream.force_ranges = NGX_CONF_UNSET;
 
     /* the hardcoded values */
     conf->upstream.cyclic_temp_file = 0;
@@ -647,6 +655,9 @@
     ngx_conf_merge_msec_value(conf->upstream.read_timeout,
                               prev->upstream.read_timeout, 60000);
 
+    ngx_conf_merge_value(conf->upstream.force_ranges,
+                              prev->upstream.force_ranges, 0);
+
     ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
                               prev->upstream.next_upstream_timeout, 0);
 


More information about the nginx-devel mailing list