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

#2605: Add safety check for type casting for QUIC dialer #2725

Merged
merged 1 commit into from Nov 14, 2023

Conversation

cty123
Copy link
Contributor

@cty123 cty123 commented Nov 13, 2023

Issue #2605 brought up real problem that QUIC dialer doesn't support sockopt at the moment. Inside internet.DialSystem(...) function, one of the branch that involves redirect(...) returns cnc.connection instance that is currently unhandled by the code logic, and thus caused program panic during runtime.

rawConn, err := internet.DialSystem(ctx, dest, sockopt)
// DialSystem calls system dialer to create a network connection.
func DialSystem(ctx context.Context, dest net.Destination, sockopt *SocketConfig) (net.Conn, error) {
	...
	if obm != nil && len(sockopt.DialerProxy) > 0 {
		nc := redirect(ctx, dest, sockopt.DialerProxy)
		if nc != nil {
			return nc, nil
		}
	}
        ...
}

It seems the sockopt support for QUIC protocol requires a couple changes including making cnc.connection public, such that we can handle in dialer, along with some thorough tests, this commit simply adds safety check to explicity state the fact that QUIC isn't working with sockopt. And the implementation of the feature can be scheduled later on.

Issue XTLS#2605 brought up real problem that QUIC dialer doesn't support sockopt at the moment. Inside `internet.DialSystem(...)` function, one of the branch that involves `redirect(...)` returns `cnc.connection` instance that is currently unhandled by the code logic, and thus caused program panic during runtime.

It seems the sockopt support for QUIC protocol requires a couple changes including making `cnc.connection` public, such that we can handle in dialer, along with some thorough tests, this commit simply adds safety check to explicity state the fact that QUIC isn't working with sockopt. And the implementation of the feature can be scheduled later on.
@cty123 cty123 changed the title #2605: Add safety check for type casting for QUIC dialer Issue #2605: Add safety check for type casting for QUIC dialer Nov 13, 2023
@cty123 cty123 changed the title Issue #2605: Add safety check for type casting for QUIC dialer #2605: Add safety check for type casting for QUIC dialer Nov 13, 2023
@yuhan6665 yuhan6665 merged commit f1c8155 into XTLS:main Nov 14, 2023
33 of 34 checks passed
@yuhan6665
Copy link
Member

Thanks! I will re-push 1.8.5 later to include it.

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.

None yet

2 participants