You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.