comparison src/core/ngx_md5.c @ 628:83b58b182b76 NGINX_1_0_4

nginx 1.0.4 *) Change: now regular expressions case sensitivity in the "map" directive is given by prefixes "~" or "~*". *) Feature: now shared zones and caches use POSIX semaphores on Linux. Thanks to Denis F. Latypoff. *) Bugfix: "stalled" cache updating" alert. *) Bugfix: nginx could not be built --without-http_auth_basic_module; the bug had appeared in 1.0.3.
author Igor Sysoev <http://sysoev.ru>
date Wed, 01 Jun 2011 00:00:00 +0400
parents 8dc007eddbcf
children ad6fee8052d7
comparison
equal deleted inserted replaced
627:a63a292c61af 628:83b58b182b76
30 ctx->bytes = 0; 30 ctx->bytes = 0;
31 } 31 }
32 32
33 33
34 void 34 void
35 ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size) 35 ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size)
36 { 36 {
37 size_t used, free; 37 size_t used, free;
38 38
39 used = ctx->bytes & 0x3f; 39 used = ctx->bytes & 0x3f;
40 ctx->bytes += size; 40 ctx->bytes += size;
45 if (size < free) { 45 if (size < free) {
46 ngx_memcpy(&ctx->buffer[used], data, size); 46 ngx_memcpy(&ctx->buffer[used], data, size);
47 return; 47 return;
48 } 48 }
49 49
50 ngx_memcpy(&ctx->buffer[used], data, free); 50 data = ngx_cpymem(&ctx->buffer[used], data, free);
51 data = (u_char *)data + free;
52 size -= free; 51 size -= free;
53 (void) ngx_md5_body(ctx, ctx->buffer, 64); 52 (void) ngx_md5_body(ctx, ctx->buffer, 64);
54 } 53 }
55 54
56 if (size >= 64) { 55 if (size >= 64) {