comparison src/http/modules/ngx_http_scgi_module.c @ 4386:92deb73393f7

Cache lock support for fastcgi, scgi, uwsgi.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 26 Dec 2011 11:16:19 +0000
parents f41b79fa95a3
children d45742815c90
comparison
equal deleted inserted replaced
4385:70ba81827472 4386:92deb73393f7
243 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, 243 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
244 ngx_conf_set_bitmask_slot, 244 ngx_conf_set_bitmask_slot,
245 NGX_HTTP_LOC_CONF_OFFSET, 245 NGX_HTTP_LOC_CONF_OFFSET,
246 offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_methods), 246 offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_methods),
247 &ngx_http_upstream_cache_method_mask }, 247 &ngx_http_upstream_cache_method_mask },
248
249 { ngx_string("scgi_cache_lock"),
250 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
251 ngx_conf_set_flag_slot,
252 NGX_HTTP_LOC_CONF_OFFSET,
253 offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_lock),
254 NULL },
255
256 { ngx_string("scgi_cache_lock_timeout"),
257 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
258 ngx_conf_set_msec_slot,
259 NGX_HTTP_LOC_CONF_OFFSET,
260 offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_lock_timeout),
261 NULL },
248 262
249 #endif 263 #endif
250 264
251 { ngx_string("scgi_temp_path"), 265 { ngx_string("scgi_temp_path"),
252 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234, 266 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
1060 conf->upstream.cache = NGX_CONF_UNSET_PTR; 1074 conf->upstream.cache = NGX_CONF_UNSET_PTR;
1061 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT; 1075 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
1062 conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR; 1076 conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR;
1063 conf->upstream.no_cache = NGX_CONF_UNSET_PTR; 1077 conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
1064 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR; 1078 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
1079 conf->upstream.cache_lock = NGX_CONF_UNSET;
1080 conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC;
1065 #endif 1081 #endif
1066 1082
1067 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR; 1083 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
1068 conf->upstream.pass_headers = NGX_CONF_UNSET_PTR; 1084 conf->upstream.pass_headers = NGX_CONF_UNSET_PTR;
1069 1085
1286 prev->upstream.cache_valid, NULL); 1302 prev->upstream.cache_valid, NULL);
1287 1303
1288 if (conf->cache_key.value.data == NULL) { 1304 if (conf->cache_key.value.data == NULL) {
1289 conf->cache_key = prev->cache_key; 1305 conf->cache_key = prev->cache_key;
1290 } 1306 }
1307
1308 ngx_conf_merge_value(conf->upstream.cache_lock,
1309 prev->upstream.cache_lock, 0);
1310
1311 ngx_conf_merge_msec_value(conf->upstream.cache_lock_timeout,
1312 prev->upstream.cache_lock_timeout, 5000);
1291 1313
1292 #endif 1314 #endif
1293 1315
1294 ngx_conf_merge_value(conf->upstream.pass_request_headers, 1316 ngx_conf_merge_value(conf->upstream.pass_request_headers,
1295 prev->upstream.pass_request_headers, 1); 1317 prev->upstream.pass_request_headers, 1);