Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: correctly error out when ngx.socket.tcp is shutdown before connect #331

Merged
merged 1 commit into from
Dec 25, 2023

Conversation

fffonion
Copy link
Contributor

@fffonion fffonion commented Dec 1, 2023

Can be reproduced by following example:

user www-data;
daemon off;
master_process off;

events {
}

stream {
	error_log /dev/stdout info;
	server {
		listen 23333;
		    content_by_lua_block {
                        local t = ngx.socket.tcp()
                        t:shutdown("send")
		    }
	}
}

This PR moves the check of u before calling ngx_stream_lua_socket_handle_write_error.

@fffonion fffonion changed the title bugfix: correctly error out when ngx.socket.tcp is shutdown before bugfix: correctly error out when ngx.socket.tcp is shutdown before connect Dec 1, 2023
@tzssangglass
Copy link

make sense

t/058-tcp-socket.t Show resolved Hide resolved
@zhuizhuhaomeng zhuizhuhaomeng merged commit ff7c65b into openresty:master Dec 25, 2023
2 of 3 checks passed
@fffonion
Copy link
Contributor Author

Thank you!

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.

3 participants