dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.27k stars 4.73k forks source link

Consider obsoleting SocketsHttpHandler.Properties #58805

Open ManickaP opened 3 years ago

ManickaP commented 3 years ago

It seems it over-lived its usefulness. It was introduced by David Shulman in this PR: https://github.com/dotnet/runtime/commit/354c2e5b9c6f2db543e1256b979c9f632b9a832f, the tracking issue is https://github.com/dotnet/runtime/issues/16941.

Generic property bag to that would allow for additional properties to be set and recognized by particular implementations (i.e. Windows vs. Unix, Unix-only connection socket options, etc.)

So, it seems it was meant for CurlHandler and WinHttpHandler, but was never used for that. It was modeled after HttpRequestMessage.Properties. https://github.com/dotnet/runtime/issues/16941#issuecomment-218573345, which were recently obsoleted.

It is used by HttpClientHandler: https://github.com/dotnet/runtime/blob/baf6353db66762dafd0d31bbba8f612bef6af8f7/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs#L303

ghost commented 3 years ago

Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.

Issue Details
It seems it over-lived its usefulness. It was introduced by David Shulman in this PR: https://github.com/dotnet/runtime/commit/354c2e5b9c6f2db543e1256b979c9f632b9a832f, the tracking issue is https://github.com/dotnet/runtime/issues/16941. > Generic property bag to that would allow for additional properties to be set and recognized by particular implementations (i.e. Windows vs. Unix, Unix-only connection socket options, etc.) So, it seems it was meant for `CurlHandler` and `WinHttpHandler`, but was never used for that. It was modeled after `HttpRequestMessage.Properties.` https://github.com/dotnet/runtime/issues/16941#issuecomment-218573345, which were recently obsoleted. It is used by `HttpClientHandler`: https://github.com/dotnet/runtime/blob/baf6353db66762dafd0d31bbba8f612bef6af8f7/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs#L303
Author: ManickaP
Assignees: -
Labels: `area-System.Net.Http`, `untriaged`
Milestone: -
karelz commented 3 years ago

Triage: It hasn't been ever used. We wouldn't add it today. But it may be potentially useful with mobile handlers. No strong opinion on obsoleting. Perhaps we should wait one more release and see if it make sense.