Skip to content

v1.0.178

Choose a tag to compare

@enetx enetx released this 30 Jan 13:12
· 57 commits to main since this release
fix(core): improve HTTP/2 connection lifecycle and context cancellation

Body changes:
- Add setupContextCancel() call in Dump() method to support context cancellation during file write operations
- Fix bug where cached empty body would attempt to read from exhausted Reader instead of writing empty file

ConnectProxy changes:
- Add closeOnError parameter to connectHTTP2() to control connection closing on errors
- Fix race condition in DialContext() by checking both conn and h2Conn before cleanup
- Add ownsConn flag to http2Conn to properly manage connection ownership when concurrent goroutines create new connections
- Implement Close() method for proxyDialer to allow explicit resource cleanup
- Prevent connection leaks when multiple goroutines attempt to establish HTTP/2 proxy connections simultaneously

The changes ensure proper connection reuse, prevent race conditions in concurrent scenarios, and add support for context cancellation in body dump operations.