-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mono.Android] Fix race condition in AndroidMessageHandler (#8753)
Fixes: #8740 There is a race condition in `AndroidMessageHandler` (see #8740 (comment) for more information). The solution is fairly simple: we should determine the decompression strategy only during the setup, when `AutomaticDecompression` is set. We don't need to do any more work during the request. To prevent changing the decompression strategy while there are requests mid-flight, the setter will only accept values until the first request is sent. This is exactly what the `SocketsHttpHandler` does. I didn't want to touch any code unrelated to the race condition in this PR so if we want to prevent other properties from being mutated while HTTP requests are being sent, we should do it in a follow-up PR.
- Loading branch information
1 parent
aea89e1
commit e41a31b
Showing
1 changed file
with
38 additions
and
36 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