Skip to content

Conversation

haga-rak
Copy link
Owner

@haga-rak haga-rak commented Aug 8, 2025

No description provided.

haga-rak added 17 commits August 7, 2025 17:04
Updated the ExchangeCompletionSource to use TrySetResult instead of SetResult. This change allows for a safer attempt to set the result without throwing an exception if the result has already been set.
Added a `_disposed` field to manage object state and prevent operations on disposed objects. Updated the `Dispose` method to check this state before proceeding. Enhanced connection management by replacing asynchronous client reading with a loop to handle incoming connections more effectively. Ensured errors are ignored during listener shutdown and that connections are properly completed before resource release.
Added a line to set the `shouldClose` variable to false
before returning the result of the status code check.
This change ensures that the connection closure logic
is consistently handled in this context.
The check for whether to close the downstream connection has been removed. The code now simply awaits the completion of the exchange without modifying the `shouldCloseConnectionToDownStream` variable.
Modified the condition for checking if reading is complete in `MetricsStream.cs`.
The check now verifies if `TotalRead` is greater than or equal to `_expectedLength` instead of the previous logic.
This change ensures correct evaluation of the final read notification when the expected length is specified.
- Added checks in `Http11PoolProcessing.cs` to manage connection closure based on response body presence and `Content-Length` header.
- Introduced `ReadUntilClose` property in `Exchange.cs` to control reading until connection closure.
- Updated `ProxyOrchestrator.cs` to close downstream connections when `ReadUntilClose` is true.
- Removed outdated comment regarding HTTP/2 response handling.
Updated the TransformResponse method to utilize an asynchronous function. The new implementation now waits for the originalStream to be drained asynchronously before creating and returning the MemoryStream with the drained content.
- Added _emptyBody and _ommitContentLength fields to ConnectionCloseTestServer.
- Updated TcpListener port from 0 to 8501 and modified constructor.
- Implemented checks for empty body and missing Content-Length in HTTP responses.
- Created RandomConnectionBehaviourTest.cs with tests for connection closure scenarios.
- Removed SubsequentSslClose.cs as it is no longer needed.
@haga-rak haga-rak added the bug Something isn't working label Aug 8, 2025
The method now returns a new object with a configured timeout of 15 seconds for the HTTP message handler, improving request management by adding a time limit for responses.
@haga-rak haga-rak merged commit 2e8e8d1 into main Aug 8, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant