comparison src/http/modules/ngx_http_auth_basic_module.c @ 2049:2a92804f4109

*) back out r2040 *) refactor ngx_palloc() *) introduce ngx_pnalloc() *) additional pool blocks have smaller header
author Igor Sysoev <igor@sysoev.ru>
date Tue, 17 Jun 2008 15:00:30 +0000
parents adca43955f79
children 7764f0fdd2a4
comparison
equal deleted inserted replaced
2048:824615f3b4ec 2049:2a92804f4109
230 230
231 ngx_http_auth_basic_close(&file); 231 ngx_http_auth_basic_close(&file);
232 232
233 if (state == sw_passwd) { 233 if (state == sw_passwd) {
234 pwd.len = i - passwd; 234 pwd.len = i - passwd;
235 pwd.data = ngx_palloc(r->pool, pwd.len + 1); 235 pwd.data = ngx_pnalloc(r->pool, pwd.len + 1);
236 if (pwd.data == NULL) { 236 if (pwd.data == NULL) {
237 return NGX_HTTP_INTERNAL_SERVER_ERROR; 237 return NGX_HTTP_INTERNAL_SERVER_ERROR;
238 } 238 }
239 239
240 ngx_cpystrn(pwd.data, &buf[passwd], pwd.len + 1); 240 ngx_cpystrn(pwd.data, &buf[passwd], pwd.len + 1);
398 return NGX_CONF_OK; 398 return NGX_CONF_OK;
399 } 399 }
400 400
401 len = sizeof("Basic realm=\"") - 1 + realm->len + 1; 401 len = sizeof("Basic realm=\"") - 1 + realm->len + 1;
402 402
403 basic = ngx_palloc(cf->pool, len); 403 basic = ngx_pnalloc(cf->pool, len);
404 if (basic == NULL) { 404 if (basic == NULL) {
405 return NGX_CONF_ERROR; 405 return NGX_CONF_ERROR;
406 } 406 }
407 407
408 p = ngx_cpymem(basic, "Basic realm=\"", sizeof("Basic realm=\"") - 1); 408 p = ngx_cpymem(basic, "Basic realm=\"", sizeof("Basic realm=\"") - 1);