* qlog: use fork of encoding/json/jsontext instead of unmaintained gojay
* implement a minimal jsontext-compatible encoder
* qlogtext: improve fuzz test
* qlog: simplify JSON encoding error handling
* qlog: make use of jsontext.Bool
* ackhandler: implement a lost packet tracker
* logging: add ConnectionTracer.DetectedSpuriousLoss event
* ackhandler: detect spurious losses
* qlog: add support for logging spurious packet loss
* ackhandler: delete lost packets after detecting spurios loss
* guard against slice index underflow
* simplify timer resets
As of Go 1.23, timer resets work as expected, and there’s no need to
read a (potentially) stale value from the timer channel.
* don't save the last time
* track if blocked
* remove unblock after sendingScheduled
* fix unblock logic when sending
* don't use fallthrough
* track the blocking mode
* remove stale comment
* implement a memory-optimized time.Time replacement
* monotime: properly handle systems with bad timer resolution (Windows)
* monotime: simplify Since
* fix: return stream frames to pool on error paths
fixes potential memory leak where StreamFrames were not returned to
sync.Pool in error/cancellation paths.
root cause: frames are llocated via GetStreamFrame() but never returned
via PutBack() when streams enter terminal states without going through
normal OnAcked() cleanup.
fixed paths:
- CancelWrite(): return frames when reliableOffset == 0
- handleStopSendingFrame(): return frames on STOP_SENDING
- closeForShutdown(): return frames on connection shutdown
- OnLost(): return frame when stream reset with no data sent
* fix: clear slice before nil assignment, remove excessive tests
- add clear() call to properly release GC references per https://github.com/quic-go/quic-go/pull/5327#discussion_r2328451862
- remove excessive pool return tests per https://github.com/quic-go/quic-go/pull/5327#discussion_r2328453227
* do not allow use a closed transport
* update tests
* add test
* Update http3/transport.go
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
* unit tests
* update test
---------
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
This allows for more accurate packet number difference calculations,
which is especially important once we attempt to detect spurious loss
detection events.
* ackhandler: optimize memory layout of packet struct
The packet number can be derived from the position that this packet is
stored at in the packets slice in the sent packet history. There is no
need to store the packet number, saving 8 bytes per packet.
* ackhandler: avoid copying the packet struct
lookup-only doesn't download the cache, even if it's there. This is not what we
intended: we still want to use the cache for PRs, we just want to upload a
new cache.
* update to Go 1.25, drop support for Go 1.23
* ci: update golangci-lint to v2.4.0
* use new go tool command for gomock / mockgen
* also update Go version used for oss-fuzz
* ackhandler: check for missing packets below reordering treshold
No functional change expected.
With the Acknowledgement Frequency extension, the reordering threshold
will become configurable. With this change, it will be easy to use the
peer-requested value instead of the predefined constant.
* improve documentation
* call HighestMissingUpTo in randomized test
* Tolerate empty reads in `quicvarint.Read`
Currently, `quicvarint.Read` misinterprets an empty read (`n==0`)
as a single zero byte. While empty reads are "discouraged" in
the `io.Reader` interface, they do sometimes happen, especially
when using `io.Pipe()`.
This change tolerates empty reads, adds a corresponding unit test,
and also includes some additional test coverage related to empty
capsules
* minor test refactor
---------
Co-authored-by: Marten Seemann <martenseemann@gmail.com>