Skip to content

Conversation

LeonardWalter
Copy link
Contributor

Add support for 0rtt connection resumption to DoH and DoQ listeners.

Copy link
Owner

@folbricht folbricht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Let's make sure that closing the connection in multiple places is actually necessary.

doqlistener.go Outdated
if err := binary.Read(stream, binary.BigEndian, &length); err != nil {
s.metrics.err.Add("read", 1)
log.WithError(err).Error("failed to read query")
CloseConn(connection, log)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of closing the connection in multiple places, including from within the stream. One effect of doing it here will be that connection.AcceptStream(ctx) above will return an error, which will then call CloseConn a second time. It should write "closing connection" twice in the logs too.

The prior implementation only closed it in one place. Is that not working? If a stream fails, I'd expect AcceptStream() to also fail, which then closes the connection.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I did remove the changes and updated the PR

@LeonardWalter
Copy link
Contributor Author

There is currently still a problem when the server restarts and the client still holds an old session ticket. I think the client should automatically retry without the session ticket after it failed to (re)open the connection. Will work on this now

Copy link
Owner

@folbricht folbricht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@folbricht folbricht merged commit 8568b53 into folbricht:master Dec 3, 2024
3 checks passed
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.

2 participants