Skip to content

feature: add socket udp peek#2

Open
assouan wants to merge 4 commits into
feature/add-socket-udp-peekfrom
feature/add-socket-udp-peek-cli
Open

feature: add socket udp peek#2
assouan wants to merge 4 commits into
feature/add-socket-udp-peekfrom
feature/add-socket-udp-peek-cli

Conversation

@assouan

@assouan assouan commented Aug 26, 2025

Copy link
Copy Markdown
Owner

No description provided.

Introduces the peek(N) method for UDP request sockets in the preread phase, allowing inspection of N bytes from the preread buffer without consuming them. Updates the UDP socket implementation, metatable, and state tracking to support this feature. Adds documentation and comprehensive tests for UDP socket peek behavior, including error and edge cases.
Replaces the coroutine cleanup handler from ngx_stream_lua_coctx_cleanup to ngx_stream_lua_udp_socket_cleanup in ngx_stream_lua_req_socket_udp_peek. This ensures proper cleanup specific to UDP socket operations when yielding due to insufficient preread buffer data.
Added a check for NULL buffer before calculating the size in ngx_stream_lua_req_socket_udp_peek_resume to prevent potential null pointer dereference.
Introduces additional debug logging when the UDP socket peek() method is called and updates an existing log message for clarity. This helps with tracing and debugging UDP socket operations in the stream lua module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant