Fix HTTP connect_timeout enforcement - #413
Conversation
There was a problem hiding this comment.
Pull request overview
Enforces HTTP connection timeouts across TCP setup and TLS handshakes for HTTP, WebSocket, and SSE clients.
Changes:
- Adds cancellable TCP connect and TLS handshake APIs.
- Applies shared connection deadlines while preserving setup errors.
- Adds TLS timeout coverage and updates documentation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
wiki/Networking.md |
Documents client timeout configuration. |
wiki/API-Reference.md |
Clarifies timeout semantics. |
tests/unit/test_http_client.cpp |
Tests stalled TLS handshake timeout. |
include/elio/tls/tls_stream.hpp |
Adds cancellable TLS handshaking. |
include/elio/net/tcp.hpp |
Adds cancellable TCP connection overloads. |
include/elio/http/websocket_client.hpp |
Passes WebSocket connection timeout. |
include/elio/http/sse_client.hpp |
Passes SSE connection timeout. |
include/elio/http/http_client.hpp |
Enforces timeout through connection pooling. |
include/elio/http/client_base.hpp |
Implements shared connection watchdog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot Please re-review the latest changes only. Do not push commits or make direct modifications. |
Reviewed commit 97947cf. All four concerns from the prior review are addressed: errno preservation ( API ambiguity ( Constructor reorder ( Cancellation tests: |
Description
Enforce the shared HTTP client
connect_timeoutduring TCP connection setup and TLS handshake. This fixes clients that could hang in connection setup even thoughbase_client_config::connect_timeoutadvertised a timeout.Type of Change
Related Issues
Closes #412
Changes Made
Core Changes
net::tcp_connectoverloads backed bycancel_token.base_client_config::connect_timeoutin the sharedclient_connectpath used by HTTP/1, WebSocket, and SSE clients.ETIMEDOUTinstead of always mapping acquire failure toECONNREFUSED.API Changes (if applicable)
Before:
After:
Migration Guide (if breaking change)
N/A. This enforces existing configuration rather than changing the public configuration surface.
Testing
Unit Tests
Integration Tests
Sanitizer Testing
Test Results
Checklist
Code Quality
Documentation
Testing
Compatibility
Performance (if applicable)
Screenshots / Diagrams
N/A.
Additional Notes
Full
ctestwas not run because this configuration includes NOT_BUILT sanitizer/RDMA placeholder tests; the targeted executable-level tests above were run instead.Reviewer Guidance
Areas requiring special attention:
tcp_connectpath.client_connectthroughhttp::client::send_request.connect_timeoutnote.Questions for reviewers: