From 8fb7e2c02cbd21ee197d288f95af13fd18138479 Mon Sep 17 00:00:00 2001 From: George Wang Date: Wed, 31 May 2023 16:37:47 -0400 Subject: [PATCH] Release 4.0.1 --- CMakeLists.txt | 1 + include/lsxpack_header.h | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 984f38f4b..81848f09c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,6 +106,7 @@ SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4245") # conversion from 'int' to 'unsi SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4267") # integer conversion SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4214") # nonstandard extension used: bit field types other than int SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4295") # array is too small to include a terminating null character +SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4324") # structure was padded due to alignment specifier SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4334") # result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4456") # hide previous local declaration SET(MY_CMAKE_FLAGS "${MY_CMAKE_FLAGS} /wd4459") # hide global declaration diff --git a/include/lsxpack_header.h b/include/lsxpack_header.h index d34c3ab83..9fd5a8bc7 100644 --- a/include/lsxpack_header.h +++ b/include/lsxpack_header.h @@ -1,6 +1,6 @@ /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ -#ifndef LSXPACK_HEADER_H_v207 -#define LSXPACK_HEADER_H_v207 +#ifndef LSXPACK_HEADER_H_v208 +#define LSXPACK_HEADER_H_v208 #ifdef __cplusplus extern "C" { @@ -14,6 +14,7 @@ extern "C" { #define LSXPACK_MAX_STRLEN UINT16_MAX #endif +typedef int32_t lsxpack_offset_t; #if LSXPACK_MAX_STRLEN == UINT16_MAX typedef uint16_t lsxpack_strlen_t; #elif LSXPACK_MAX_STRLEN == UINT32_MAX @@ -49,9 +50,9 @@ struct lsxpack_header char *buf; /* the buffer for headers */ uint32_t name_hash; /* hash value for name */ uint32_t nameval_hash; /* hash value for name + value */ - lsxpack_strlen_t name_offset; /* the offset for name in the buffer */ + lsxpack_offset_t name_offset; /* the offset for name in the buffer */ + lsxpack_offset_t val_offset; /* the offset for value in the buffer */ lsxpack_strlen_t name_len; /* the length of name */ - lsxpack_strlen_t val_offset; /* the offset for value in the buffer */ lsxpack_strlen_t val_len; /* the length of value */ uint16_t chain_next_idx; /* mainly for cookie value chain */ uint8_t hpack_index; /* HPACK static table index */ @@ -99,11 +100,11 @@ lsxpack_header_set_offset(lsxpack_header_t *hdr, const char *buf, { memset(hdr, 0, sizeof(*hdr)); hdr->buf = (char *)buf; - hdr->name_offset = (lsxpack_strlen_t)name_offset; + hdr->name_offset = (lsxpack_offset_t)name_offset; assert(name_len <= LSXPACK_MAX_STRLEN); hdr->name_len = (lsxpack_strlen_t)name_len; assert(name_offset + name_len + 2 <= LSXPACK_MAX_STRLEN); - hdr->val_offset = (lsxpack_strlen_t)(name_offset + name_len + 2); + hdr->val_offset = (lsxpack_offset_t)(name_offset + name_len + 2); assert(val_len <= LSXPACK_MAX_STRLEN); hdr->val_len = (lsxpack_strlen_t)val_len; } @@ -116,11 +117,11 @@ lsxpack_header_set_offset2(lsxpack_header_t *hdr, const char *buf, { memset(hdr, 0, sizeof(*hdr)); hdr->buf = (char *)buf; - hdr->name_offset = (lsxpack_strlen_t)name_offset; + hdr->name_offset = (lsxpack_offset_t)name_offset; assert(name_len <= LSXPACK_MAX_STRLEN); hdr->name_len = (lsxpack_strlen_t)name_len; assert(val_offset <= LSXPACK_MAX_STRLEN); - hdr->val_offset = (lsxpack_strlen_t)val_offset; + hdr->val_offset = (lsxpack_offset_t)val_offset; assert(val_len <= LSXPACK_MAX_STRLEN); hdr->val_len = (lsxpack_strlen_t)val_len; } @@ -133,7 +134,7 @@ lsxpack_header_prepare_decode(lsxpack_header_t *hdr, memset(hdr, 0, sizeof(*hdr)); hdr->buf = out; assert(offset <= LSXPACK_MAX_STRLEN); - hdr->name_offset = (lsxpack_strlen_t)offset; + hdr->name_offset = (lsxpack_offset_t)offset; if (len > LSXPACK_MAX_STRLEN) hdr->val_len = LSXPACK_MAX_STRLEN; else @@ -166,4 +167,4 @@ lsxpack_header_mark_val_changed(lsxpack_header_t *hdr) } #endif -#endif //LSXPACK_HEADER_H_v207 +#endif //LSXPACK_HEADER_H_v208