-#undef CASE_HTTP_ETAG_HASH
-#define CASE_HTTP_ETAG_HASH(HASH) \
- case HTTP_ETAG_##HASH: \
- ZEND_WRITE("HTTP_ETAG_"#HASH, lenof("HTTP_ETAG_"#HASH)); \
- break;
-PHP_INI_DISP(http_etag_mode_displayer)
-{
- long value;
-
- if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
- value = (ini_entry->orig_value) ? atoi(ini_entry->orig_value) : HTTP_ETAG_MD5;
- } else if (ini_entry->value) {
- value = (ini_entry->value[0]) ? atoi(ini_entry->value) : HTTP_ETAG_MD5;
- } else {
- value = HTTP_ETAG_MD5;
- }
-
- switch (value)
- {
-#ifdef HTTP_HAVE_HASH_EXT
- CASE_HTTP_ETAG_HASH(RIPEMD160);
- CASE_HTTP_ETAG_HASH(RIPEMD128);
- CASE_HTTP_ETAG_HASH(SHA512);
- CASE_HTTP_ETAG_HASH(SHA384);
- CASE_HTTP_ETAG_HASH(SHA256);
-#endif
- CASE_HTTP_ETAG_HASH(CRC32);
- CASE_HTTP_ETAG_HASH(SHA1);
-#ifndef HTTP_HAVE_MHASH
- default:
-#endif
- CASE_HTTP_ETAG_HASH(MD5);
-
-#ifdef HTTP_HAVE_MHASH
- default:
- {
- const char *hash_name = mhash_get_hash_name_static(value);
-
- if (!hash_name) {
- ZEND_WRITE("HTTP_ETAG_MD5", lenof("HTTP_ETAG_MD5"));
- } else {
- ZEND_WRITE("HTTP_ETAG_MHASH_", lenof("HTTP_ETAG_MHASH_"));
- ZEND_WRITE(hash_name, strlen(hash_name));
- }
- }
- break;
-#endif
- }
-}
-