X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=src%2Fphp_http_etag.c;h=a02548cc028c5d0c81103abc09ce029a60588353;hp=3604ad8673957f6ca4f52f35420fe06cb15eae14;hb=b41323e1817c50d062b27da798c7db35fa58212c;hpb=bdd6edb59194cda9e5fcb393c48ab4230fceb32a diff --git a/src/php_http_etag.c b/src/php_http_etag.c index 3604ad8..a02548c 100644 --- a/src/php_http_etag.c +++ b/src/php_http_etag.c @@ -16,11 +16,11 @@ # include "php_hash.h" #endif -#include -#include -#include +#include "ext/standard/crc32.h" +#include "ext/standard/sha1.h" +#include "ext/standard/md5.h" -php_http_etag_t *php_http_etag_init(const char *mode TSRMLS_DC) +php_http_etag_t *php_http_etag_init(const char *mode) { void *ctx; php_http_etag_t *e; @@ -47,7 +47,6 @@ php_http_etag_t *php_http_etag_init(const char *mode TSRMLS_DC) e = emalloc(sizeof(*e)); e->ctx = ctx; e->mode = estrdup(mode); - TSRMLS_SET_CTX(e->ts); return e; } @@ -80,7 +79,7 @@ char *php_http_etag_finish(php_http_etag_t *e) #ifdef PHP_HTTP_HAVE_HASH const php_hash_ops *eho = NULL; - if (e->mode && (eho = php_hash_fetch_ops(e->mode, strlen(e->mode)))) { + if ((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); } @@ -110,7 +109,7 @@ size_t php_http_etag_update(php_http_etag_t *e, const char *data_ptr, size_t dat #ifdef PHP_HTTP_HAVE_HASH const php_hash_ops *eho = NULL; - if (e->mode && (eho = php_hash_fetch_ops(e->mode, strlen(e->mode)))) { + if ((eho = php_hash_fetch_ops(e->mode, strlen(e->mode)))) { eho->hash_update(e->ctx, (const unsigned char *) data_ptr, data_len); } #endif