3
0
mirror of https://github.com/nginx/nginx.git synced 2024-12-27 01:11:13 -06:00

make built-in ngx_md5_update() interface consistent with other implemenations

This commit is contained in:
Igor Sysoev 2011-05-27 10:00:46 +00:00
parent c4793b6505
commit e620fdac65
2 changed files with 3 additions and 4 deletions

View File

@ -32,7 +32,7 @@ ngx_md5_init(ngx_md5_t *ctx)
void
ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size)
ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size)
{
size_t used, free;
@ -47,8 +47,7 @@ ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size)
return;
}
ngx_memcpy(&ctx->buffer[used], data, free);
data = (u_char *)data + free;
data = ngx_cpymem(&ctx->buffer[used], data, free);
size -= free;
(void) ngx_md5_body(ctx, ctx->buffer, 64);
}

View File

@ -50,7 +50,7 @@ typedef struct {
void ngx_md5_init(ngx_md5_t *ctx);
void ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size);
void ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size);
void ngx_md5_final(u_char result[16], ngx_md5_t *ctx);