mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 15:49:58 +00:00
TUN-8748: Migrated datagram V3 flows to use migrated context
Previously, during local flow migration the current connection context was not part of the migration and would cause the flow to still be listening on the connection context of the old connection (before the migration). This meant that if a flow was migrated from connection 0 to connection 1, and connection 0 goes away, the flow would be early terminated incorrectly with the context lifetime of connection 0. The new connection context is provided during migration of a flow and will trigger the observe loop for the flow lifetime to be rebound to this provided context. Closes TUN-8748
This commit is contained in:
@@ -619,12 +619,14 @@ func newMockSession() mockSession {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *mockSession) ID() v3.RequestID { return testRequestID }
|
||||
func (m *mockSession) RemoteAddr() net.Addr { return testOriginAddr }
|
||||
func (m *mockSession) LocalAddr() net.Addr { return testLocalAddr }
|
||||
func (m *mockSession) ConnectionID() uint8 { return 0 }
|
||||
func (m *mockSession) Migrate(conn v3.DatagramConn, log *zerolog.Logger) { m.migrated <- conn.ID() }
|
||||
func (m *mockSession) ResetIdleTimer() {}
|
||||
func (m *mockSession) ID() v3.RequestID { return testRequestID }
|
||||
func (m *mockSession) RemoteAddr() net.Addr { return testOriginAddr }
|
||||
func (m *mockSession) LocalAddr() net.Addr { return testLocalAddr }
|
||||
func (m *mockSession) ConnectionID() uint8 { return 0 }
|
||||
func (m *mockSession) Migrate(conn v3.DatagramConn, ctx context.Context, log *zerolog.Logger) {
|
||||
m.migrated <- conn.ID()
|
||||
}
|
||||
func (m *mockSession) ResetIdleTimer() {}
|
||||
|
||||
func (m *mockSession) Serve(ctx context.Context) error {
|
||||
close(m.served)
|
||||
|
Reference in New Issue
Block a user