-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trim more Http DiagnosticsHandler code (#39525)
Since the DiagnosticsHandler still gets instantiated in the HttpClientHandler, none of its overriden methods are getting trimmed. This leads to System.Diagnostics.DiagnosticListener still being preserved in a linked application. The fix is to split DiagnosticsHandler.IsEnabled() into two methods: * IsGloballyEnabled() - checks the AppContext switch, and is replaced by the linker by a feature swtich. * IsEnabled() - which checks IsGloballyEnabled() and if there is an Activity or listener available. This allows all but the IsEnabled and IsGloballyEnabled methods to get trimmed on DiagnosticsHandler. Contributes to #38765
- Loading branch information
Showing
4 changed files
with
15 additions
and
7 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
2 changes: 1 addition & 1 deletion
2
src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<linker> | ||
<assembly fullname="System.Net.Http"> | ||
<type fullname="System.Net.Http.DiagnosticsHandler"> | ||
<method signature="System.Boolean IsEnabled()" body="stub" value="false" feature="System.Net.Http.EnableActivityPropagation" featurevalue="false" /> | ||
<method signature="System.Boolean IsGloballyEnabled()" body="stub" value="false" feature="System.Net.Http.EnableActivityPropagation" featurevalue="false" /> | ||
</type> | ||
</assembly> | ||
</linker> |
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