From 28804e8c80a119f90bec2bf95565e1a507d57a12 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Sun, 6 Jun 2021 02:17:32 -0400 Subject: [PATCH] [core] comment out unused part of http_etag_remix note: etag buffer etag->ptr might be NULL (etag->used = etag->sze = 0) so buffer will need to be extended, not truncated, in that case. buffer_string_set_length() is typically used to truncate strings. --- src/http_etag.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/http_etag.c b/src/http_etag.c index 3ebd51b9..a1fdfc1e 100644 --- a/src/http_etag.c +++ b/src/http_etag.c @@ -47,11 +47,15 @@ static void http_etag_remix (buffer * const etag, const char * const str, const uint32_t len) { uint32_t h = dekhash(str, len, len); /*(pass len as initial hash value)*/ + #if 0 /*(currently never elen > 2; always cleared in http_etag_create())*/ uint32_t elen = buffer_string_length(etag); if (elen > 2) /*(expect "..." if set)*/ h = dekhash(etag->ptr+1, elen-2, h); buffer_string_set_length(etag, 1); etag->ptr[0] = '\"'; + #else + buffer_copy_string_len(etag, CONST_STR_LEN("\"")); + #endif buffer_append_int(etag, h); buffer_append_string_len(etag, CONST_STR_LEN("\"")); }