diff options
author | Igor Sysoev <igor@sysoev.ru> | 2010-05-14 09:56:37 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2010-05-14 09:56:37 +0000 |
commit | 05b1a8f1e3595beab4397e25c2a6db9d832a6a97 (patch) | |
tree | 282923e87cbaf9d634dab4a7c69ce85d602effcf /src/http/modules/ngx_http_auth_basic_module.c | |
parent | 328df7a5cc91180fef3b1b58129e14bc79bef80b (diff) | |
download | nginx-05b1a8f1e3595beab4397e25c2a6db9d832a6a97.tar.gz nginx-05b1a8f1e3595beab4397e25c2a6db9d832a6a97.zip |
ngx_str_set() and ngx_str_null()
Diffstat (limited to 'src/http/modules/ngx_http_auth_basic_module.c')
-rw-r--r-- | src/http/modules/ngx_http_auth_basic_module.c | 7 |
1 files changed, 2 insertions, 5 deletions
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; } |