Skip to content

Commit 16de4be

Browse files
authored
bugfix: Fix handling of new list elements.
Signed-off by: lijunlong <[email protected]>
1 parent 39941d4 commit 16de4be

5 files changed

+13
-0
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ env:
5050
- LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH
5151
- DRIZZLE_VER=2011.07.21
5252
- TEST_NGINX_SLEEP=0.006
53+
- MALLOC_PERTURB_=9
5354
jobs:
5455
- NGINX_VERSION=1.21.4 OPENSSL_VER=1.1.0l OPENSSL_PATCH_VER=1.1.0d
5556
- NGINX_VERSION=1.21.4 OPENSSL_VER=1.1.1s OPENSSL_PATCH_VER=1.1.1f

src/ngx_http_lua_control.c

+3
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ ngx_http_lua_ngx_redirect(lua_State *L)
280280

281281
h->value.len = len;
282282
h->value.data = uri;
283+
#if defined(nginx_version) && nginx_version >= 1023000
284+
h->next = NULL;
285+
#endif
283286
ngx_str_set(&h->key, "Location");
284287

285288
r->headers_out.status = rc;

src/ngx_http_lua_headers_in.c

+3
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ ngx_http_set_header_helper(ngx_http_request_t *r, ngx_http_lua_header_val_t *hv,
280280

281281
h->key = hv->key;
282282
h->value = *value;
283+
#if defined(nginx_version) && nginx_version >= 1023000
284+
h->next = NULL;
285+
#endif
283286

284287
h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
285288
if (h->lowcase_key == NULL) {

src/ngx_http_lua_headers_out.c

+3
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ ngx_http_set_header_helper(ngx_http_request_t *r, ngx_http_lua_header_val_t *hv,
229229

230230
h->key = hv->key;
231231
h->value = *value;
232+
#if defined(nginx_version) && nginx_version >= 1023000
233+
h->next = NULL;
234+
#endif
232235

233236
h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
234237
if (h->lowcase_key == NULL) {

src/ngx_http_lua_subrequest.c

+3
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,9 @@ ngx_http_lua_copy_request_headers(ngx_http_request_t *sr,
16671667

16681668
clh->hash = ngx_http_lua_content_length_hash;
16691669
clh->key = ngx_http_lua_content_length_header_key;
1670+
#if defined(nginx_version) && nginx_version >= 1023000
1671+
clh->next = NULL;
1672+
#endif
16701673
clh->lowcase_key = ngx_pnalloc(sr->pool, clh->key.len);
16711674
if (clh->lowcase_key == NULL) {
16721675
return NGX_ERROR;

0 commit comments

Comments
 (0)