Repository navigation
all: Use Go 1.21, new QUIC API - #9040
Conversation
| } | ||
|
|
||
| func (t *transportPacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error) { | ||
| return t.tran.WriteTo(p, addr) |
There was a problem hiding this comment.
Hopefully this doesn't hang, but feels like adding deadline suport would make sense?
There was a problem hiding this comment.
I don't know how to do that, though... I mean, we could launch the Write() on a separate goroutine and do some channel stuff with a select on a timeout channel to return in a timely fashion and just abandon the blocked Write() in the background forever, but ... is it worth it? Gut feeling says the accelerated magic stuff used under the hood may not do write timeouts, and UDP should Never(tm) block anyway as far as I can imagine
There was a problem hiding this comment.
@marten-seemann perhaps transport should expose SetWriteDeadline from conn?
There was a problem hiding this comment.
There's nothing the transport can do with a write deadline, other than setting it on the underlying connection, which would not be a good idea.
| } | ||
|
|
||
| func (t *transportPacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error) { | ||
| return t.tran.ReadNonQUICPacket(context.TODO(), p) |
There was a problem hiding this comment.
Why can't we have a local var context with a timeout that is created when SetDeadline/SetReadDeadline is called, and then used instead of the TODO()?
There was a problem hiding this comment.
We can, did that, the other was ... TODO :)
| quicTransport := &quic.Transport{ | ||
| Conn: udpConn, | ||
| Tracer: tracer, | ||
| } |
There was a problem hiding this comment.
Should we quicTransport.Close() along side the udpConn.Close() ?
There was a problem hiding this comment.
Looks like it may not do much in the case where it didn't create the conn itself, but it also won't hurt so, yes, sure.
|
@AudriusButkevicius PTAL |
|
Lgtm |
|
This should hopefully reduce the strain of go version updates in the future as quic-go doesn't fork crypto/tls anymore: |
* main: build: Update dependencies (syncthing#9046) all: Use Go 1.21, new QUIC API (syncthing#9040) gui, man, authors: Update docs, translations, and contributors script: Remove find-metrics which belongs in docs gui: Fix inadvertently always-false comparison (ref syncthing#7726) gui, man, authors: Update docs, translations, and contributors
Incomplete pending API support on the QUIC side, but this is roughly what I imagine the update would look like.