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

http3 ConnContext regression in v0.43 #4479

Closed
rthellend opened this issue May 3, 2024 · 2 comments · Fixed by #4480
Closed

http3 ConnContext regression in v0.43 #4479

rthellend opened this issue May 3, 2024 · 2 comments · Fixed by #4480

Comments

@rthellend
Copy link
Contributor

s.ServeQUICConn(conn) calls s.handleConn(conn),

handleConn(conn) wraps conn in an internal object "hconn":

hconn := newConnection(
		conn,
		s.EnableDatagrams,
		protocol.PerspectiveServer,
		s.Logger,
	)

which is eventually passed to ConnContext instead of the actual conn.

The expected behavior is to receive the original conn.

@rthellend
Copy link
Contributor Author

ConnContext called with &http3.connection{Connection:(*netw.QUICConn)(0xc000159490), perspective:1, logger:(*slog.Logger)(nil), enableDatagrams:false, decoder:(*qpack.Decoder)(0xc0001fd020), streamMx:sync.Mutex{state:0, sema:0x0}, streams:map[protocol.StreamID]*http3.datagrammer{0:(*http3.datagrammer)(0xc000000280)}, settings:(*http3.Settings)(0xc0003a82f0), receivedSettings:(chan struct {})(0xc0000401e0)}

Where *netw.QUICConn is my own quic.Connection wrapper, which cannot be reached anymore.

@rthellend
Copy link
Contributor Author

rthellend commented May 3, 2024

The fix would be something like:

	if s.ConnContext != nil {
-		ctx = s.ConnContext(ctx, conn)
+		ctx = s.ConnContext(ctx, conn.Connection)
		if ctx == nil {
			panic("http3: ConnContext returned nil")
		}
	}

rthellend added a commit to rthellend/quic-go that referenced this issue May 3, 2024
rthellend added a commit to c2FmZQ/tlsproxy that referenced this issue May 3, 2024
@marten-seemann marten-seemann linked a pull request May 3, 2024 that will close this issue
marten-seemann pushed a commit that referenced this issue May 3, 2024
* http3: Pass original Conn to ConnContext

#4479

* Update test to check conn value
marten-seemann pushed a commit that referenced this issue May 3, 2024
* http3: Pass original Conn to ConnContext

#4479

* Update test to check conn value
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 a pull request may close this issue.

1 participant