X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_etag.c;h=891717d0bf8a6e46573f83a262b1bcd2beafca44;hp=40757f799968a000558365347f471810270e26fd;hb=4d68865693332389b875e4466f8b5368c0876e15;hpb=a07b79b1871054ca17e48b69445b4dc201f24662 diff --git a/php_http_etag.c b/php_http_etag.c index 40757f7..891717d 100644 --- a/php_http_etag.c +++ b/php_http_etag.c @@ -1,4 +1,16 @@ -#include "php_http.h" +/* + +--------------------------------------------------------------------+ + | PECL :: http | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2004-2011, Michael Wallner | + +--------------------------------------------------------------------+ +*/ + +#include "php_http_api.h" #ifdef PHP_HTTP_HAVE_HASH # include "php_hash.h" @@ -48,7 +60,7 @@ PHP_HTTP_API char *php_http_etag_finish(php_http_etag_t *e) #ifdef PHP_HTTP_HAVE_HASH const php_hash_ops *eho = NULL; - if (mode && (eho = php_hash_fetch_ops(e->mode, strlen(e->mode)))) { + if (e->mode && (eho = php_hash_fetch_ops(e->mode, strlen(e->mode)))) { eho->hash_final(digest, e->ctx); etag = php_http_etag_digest(digest, eho->digest_size); } else @@ -75,7 +87,7 @@ PHP_HTTP_API size_t php_http_etag_update(php_http_etag_t *e, const char *data_pt #ifdef PHP_HTTP_HAVE_HASH const php_hash_ops *eho = NULL; - if (mode && (eho = php_hash_fetch_ops(e->mode, strlen(e->mode)))) { + if (e->mode && (eho = php_hash_fetch_ops(e->mode, strlen(e->mode)))) { eho->hash_update(e->ctx, (const unsigned char *) data_ptr, data_len); } else #endif @@ -94,3 +106,13 @@ PHP_HTTP_API size_t php_http_etag_update(php_http_etag_t *e, const char *data_pt return data_len; } + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ +