From 05b1a8f1e3595beab4397e25c2a6db9d832a6a97 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 14 May 2010 09:56:37 +0000 Subject: ngx_str_set() and ngx_str_null() --- src/http/modules/ngx_http_auth_basic_module.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/http/modules/ngx_http_auth_basic_module.c') diff --git a/src/http/modules/ngx_http_auth_basic_module.c b/src/http/modules/ngx_http_auth_basic_module.c index c9ce694ef..a6b95fa1d 100644 --- a/src/http/modules/ngx_http_auth_basic_module.c +++ b/src/http/modules/ngx_http_auth_basic_module.c @@ -348,8 +348,7 @@ ngx_http_auth_basic_set_realm(ngx_http_request_t *r, ngx_str_t *realm) } r->headers_out.www_authenticate->hash = 1; - r->headers_out.www_authenticate->key.len = sizeof("WWW-Authenticate") - 1; - r->headers_out.www_authenticate->key.data = (u_char *) "WWW-Authenticate"; + ngx_str_set(&r->headers_out.www_authenticate->key, "WWW-Authenticate"); r->headers_out.www_authenticate->value = *realm; return NGX_HTTP_UNAUTHORIZED; @@ -425,9 +424,7 @@ ngx_http_auth_basic(ngx_conf_t *cf, void *post, void *data) u_char *basic, *p; if (ngx_strcmp(realm->data, "off") == 0) { - realm->len = 0; - realm->data = (u_char *) ""; - + ngx_str_set(realm, ""); return NGX_CONF_OK; } -- cgit