generated from JustArchiNET/ASF-PluginTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use SocketsHttpHandler & Implement property access with reflection fo…
…r resiliency (fix #99) Change HttpClientHandler to SocketsHttpHandler to match ArchiSteamFarm upstream code This commit addresses the issue raised in #99 by using reflection to set properties on `SocketsHttpHandler` and `HttpClient`. This ensures that our code continues to function even if the property names are changed in a future trimmed binary. **Changes:** * Modified `SimpleHttpClient` constructor to use reflection-based property setting for: * `AutomaticDecompression` * `MaxConnectionsPerServer` * `EnableMultipleHttp2Connections` * Added a new helper method `SetPropertyValue` for generic property access with logging. * Updated `SetExpectContinueProperty` to use reflection as well. * Introduced a new method `SetPropertyWithLogging` to handle potential exceptions and log warnings if property access fails. * Updated `Directory.Build.props` to increment the version to `1.7.1.0`. **Additional Notes:** * Reflection can be slightly slower than direct property access. However, this approach offers greater flexibility and resilience to potential changes in the underlying libraries. **This commit is related to issue #99.**
- Loading branch information
Showing
2 changed files
with
58 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters