comparison src/http/modules/ngx_http_auth_basic_module.c @ 635:e67b227c8dbb default tip

Merge with current.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 25 Apr 2011 04:07:55 +0400
parents b4dcae568a2a
children
comparison
equal deleted inserted replaced
578:f3a9e57d2e17 635:e67b227c8dbb
246 } 246 }
247 } 247 }
248 248
249 if (state == sw_passwd) { 249 if (state == sw_passwd) {
250 left = left + n - passwd; 250 left = left + n - passwd;
251 ngx_memcpy(buf, &buf[passwd], left); 251 ngx_memmove(buf, &buf[passwd], left);
252 passwd = 0; 252 passwd = 0;
253 253
254 } else { 254 } else {
255 left = 0; 255 left = 0;
256 } 256 }
346 if (r->headers_out.www_authenticate == NULL) { 346 if (r->headers_out.www_authenticate == NULL) {
347 return NGX_HTTP_INTERNAL_SERVER_ERROR; 347 return NGX_HTTP_INTERNAL_SERVER_ERROR;
348 } 348 }
349 349
350 r->headers_out.www_authenticate->hash = 1; 350 r->headers_out.www_authenticate->hash = 1;
351 r->headers_out.www_authenticate->key.len = sizeof("WWW-Authenticate") - 1; 351 ngx_str_set(&r->headers_out.www_authenticate->key, "WWW-Authenticate");
352 r->headers_out.www_authenticate->key.data = (u_char *) "WWW-Authenticate";
353 r->headers_out.www_authenticate->value = *realm; 352 r->headers_out.www_authenticate->value = *realm;
354 353
355 return NGX_HTTP_UNAUTHORIZED; 354 return NGX_HTTP_UNAUTHORIZED;
356 } 355 }
357 356
423 422
424 size_t len; 423 size_t len;
425 u_char *basic, *p; 424 u_char *basic, *p;
426 425
427 if (ngx_strcmp(realm->data, "off") == 0) { 426 if (ngx_strcmp(realm->data, "off") == 0) {
428 realm->len = 0; 427 ngx_str_set(realm, "");
429 realm->data = (u_char *) "";
430
431 return NGX_CONF_OK; 428 return NGX_CONF_OK;
432 } 429 }
433 430
434 len = sizeof("Basic realm=\"") - 1 + realm->len + 1; 431 len = sizeof("Basic realm=\"") - 1 + realm->len + 1;
435 432