mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
This is a large PR and addresses work item dotnet/corefx#3000. I apologize for not being able to structure it in a series of smaller commits. The bulk of this PR is switching WinHttpHandler to use the async pattern of calling WinHTTP APIs. This involved a significant restructuring of the code. As part of that, I split up the large WinHttpHandler class into multiple, smaller, helper classes. While the intent of using async WinHTTP calls is better performance and cancel-ability, this PR has not been fully optimized yet. Due to the schedule of RC1 code complete next week, it's important that this PR get in and get mileage on it in the next few weeks. There are several TODO items that will be done in later PR's. There is still work being tracked in dotnet/corefx#2165 for various follow-up items. For example, re-conciling the best SafeHandle pattern to use for WinHTTP between WebSockets.Client and WinHttpHandler. I'm currently using a simple Debug.WriteLine for verbose debug logging which can be turned on/off via environment variable. I plan to switch this to System.Net ETW trace loggers in the next commit and/or PR. But the logging has proved very useful in diagnosing issues. Please provide feedback. Depending on the feedback, some of it will be marked as follow-up items for future PRs. Commit migrated from https://github.com/dotnet/corefx/commit/d8e5371a5d0f9f4bb3aa85127cb78adf89dde1fb