If the packet doesn't contain an ACK (i.e. the payload is empty),
there's no point retrying to pack it later. It's extremely unlikely that
the available packet size will suddenly increase.
* http3: typo in ListenAndServe docs
Also, partially prevent a goroutine leak on an error from one of the
listeners.
* http3: improve documentation for ListenAndServe
---------
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
* interrupt the stream when a panick happened
* move the declaration of errPanicked
* check what's read is a prefix of what's written
* check errPanicked
* use MatchError instead of Equal
* use channel to notify the response has been received
* http3: add remote address to request context
Add the remote address of the underlying packet connection to the
HTTP request context. This is useful for applications that need access
to the actual remote address (wrapped in a net.Addr) rather than just
its string representation.
Fixes#4198
* add an integration test to the self test suite.
I was not sure how deep we want to go to assure the right value is set.
For now, it asserts that a net.Addr is present in the context.
Due to the dynamic nature of the requests, it is a bit harder to know
exactly how the remote address will look like. IPv4 vs IPv6, random high
port. I think it is fine to only assert that the value is present.
* fix: add close func in example
Signed-off-by: rfyiamcool <rfyiamcool@163.com>
* fix: add close func in example
Signed-off-by: rfyiamcool <rfyiamcool@163.com>
* fix: add close func in example
Signed-off-by: rfyiamcool <rfyiamcool@163.com>
---------
Signed-off-by: rfyiamcool <rfyiamcool@163.com>
When resuming a TLS session using Dial (and not DialEarly), 0-RTT should
be disabled at the TLS layer, even if the session ticket allows for
0-RTT resumption.
This bug is not critical, since Dial doesn't return an EarlyConnection,
so the client wouldn't be able to actually send 0-RTT data in practice.
This is more consistent with both the RFC and the rest of the API. For
example, the option in the Config is already name EnableDatagrams, and
the property in the ConnectionState is named SupportsDatagrams.
* http3: HEAD method should not have a body
* add tests
* Update http3/server.go
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
* ruduce the size of responseWriter
---------
Co-authored-by: Marten Seemann <martenseemann@gmail.com>