30 static void *ngx_http_degradation_create_main_conf(
ngx_conf_t *cf);
31 static void *ngx_http_degradation_create_loc_conf(
ngx_conf_t *cf);
32 static char *ngx_http_degradation_merge_loc_conf(
ngx_conf_t *cf,
void *parent,
61 ngx_http_degradation_init,
63 ngx_http_degradation_create_main_conf,
69 ngx_http_degradation_create_loc_conf,
70 ngx_http_degradation_merge_loc_conf
76 &ngx_http_degradation_module_ctx,
77 ngx_http_degradation_commands,
110 static size_t sbrk_size;
111 static time_t sbrk_time;
123 if (now != sbrk_time) {
132 sbrk_size = (size_t) sbrk(0) - ((uintptr_t)
ngx_palloc & ~0x3FFFFF);
142 "degradation sbrk:%uzM",
143 sbrk_size / (1024 * 1024));
155 ngx_http_degradation_create_main_conf(
ngx_conf_t *cf)
169 ngx_http_degradation_create_loc_conf(
ngx_conf_t *cf)
185 ngx_http_degradation_merge_loc_conf(
ngx_conf_t *cf,
void *parent,
void *child)
213 "invalid sbrk size \"%V\"", &value[1]);
221 "invalid parameter \"%V\"", &value[1]);
240 *h = ngx_http_degradation_handler;