-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(patches): add patches from upstream openresty (#13640)
* chore(patches): add patches from upstream openresty Fixing the issue where a connection can't be setkeepalive successfully when using TLSv1.3. The issue was originally found in the tcp-log plugin. \### Summary \#### ngx_lua patches - openresty/lua-nginx-module@bf4bdcd - openresty/lua-nginx-module@ea09d92 - openresty/lua-nginx-module@816483d \#### ngx_stream_lua patches - openresty/stream-lua-nginx-module@5954e22 - openresty/stream-lua-nginx-module@69f0cd7 - openresty/stream-lua-nginx-module@1e1d93e https://konghq.atlassian.net/browse/FTI-6190 * chore(fixture): fix tcp_server, SSL_shutdown only does a half close, so the connection can still be reused.
- Loading branch information
Showing
3 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
build/openresty/patches/ngx_lua-0.10.26_07-tcpsock-setkeepalive-tls13.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/bundle/ngx_lua-0.10.26/src/ngx_http_lua_socket_tcp.c b/bundle/ngx_lua-0.10.26/src/ngx_http_lua_socket_tcp.c | ||
index 037faef..0e6dcd0 100644 | ||
--- a/bundle/ngx_lua-0.10.26/src/ngx_http_lua_socket_tcp.c | ||
+++ b/bundle/ngx_lua-0.10.26/src/ngx_http_lua_socket_tcp.c | ||
@@ -5731,7 +5731,7 @@ ngx_http_lua_socket_keepalive_close_handler(ngx_event_t *ev) | ||
ngx_http_lua_socket_pool_t *spool; | ||
|
||
int n; | ||
- char buf[1]; | ||
+ unsigned char buf[1]; | ||
ngx_connection_t *c; | ||
|
||
c = ev->data; | ||
@@ -5752,9 +5752,10 @@ ngx_http_lua_socket_keepalive_close_handler(ngx_event_t *ev) | ||
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ev->log, 0, | ||
"lua tcp socket keepalive close handler check stale events"); | ||
|
||
- n = recv(c->fd, buf, 1, MSG_PEEK); | ||
+ /* consume the possible ssl-layer data implicitly */ | ||
+ n = c->recv(c, buf, 1); | ||
|
||
- if (n == -1 && ngx_socket_errno == NGX_EAGAIN) { | ||
+ if (n == NGX_AGAIN) { | ||
/* stale event */ | ||
|
||
if (ngx_handle_read_event(c->read, 0) != NGX_OK) { |
26 changes: 26 additions & 0 deletions
26
build/openresty/patches/ngx_stream_lua-0.0.14_06-tcpsock-setkeepalive-tls13.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/bundle/ngx_stream_lua-0.0.14/src/ngx_stream_lua_socket_tcp.c b/bundle/ngx_stream_lua-0.0.14/src/ngx_stream_lua_socket_tcp.c | ||
index 9d5472a..c5b33df 100644 | ||
--- a/bundle/ngx_stream_lua-0.0.14/src/ngx_stream_lua_socket_tcp.c | ||
+++ b/bundle/ngx_stream_lua-0.0.14/src/ngx_stream_lua_socket_tcp.c | ||
@@ -5595,7 +5595,7 @@ ngx_stream_lua_socket_keepalive_close_handler(ngx_event_t *ev) | ||
ngx_stream_lua_socket_pool_t *spool; | ||
|
||
int n; | ||
- char buf[1]; | ||
+ unsigned char buf[1]; | ||
ngx_connection_t *c; | ||
|
||
c = ev->data; | ||
@@ -5617,9 +5617,10 @@ ngx_stream_lua_socket_keepalive_close_handler(ngx_event_t *ev) | ||
"stream lua tcp socket keepalive close handler " | ||
"check stale events"); | ||
|
||
- n = recv(c->fd, buf, 1, MSG_PEEK); | ||
+ /* consume the possible ssl-layer data implicitly */ | ||
+ n = c->recv(c, buf, 1); | ||
|
||
- if (n == -1 && ngx_socket_errno == NGX_EAGAIN) { | ||
+ if (n == NGX_AGAIN) { | ||
/* stale event */ | ||
|
||
if (ngx_handle_read_event(c->read, 0) != NGX_OK) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eff5e8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bazel Build
Docker image available
kong/kong:eff5e8f1dbe03ce0aa095dcb4cd152dfc0407e00
Artifacts available https://github.com/Kong/kong/actions/runs/12079947309