From a8245a5b9e63bdabfb9dcb90a6cff761cac3af58 Mon Sep 17 00:00:00 2001 From: Jon Hanna Date: Sat, 16 Dec 2017 19:25:43 +0000 Subject: [PATCH] Use cancellationToken in two places it was missed. (#1539) I'm not sure if this was a simple slip up, or if I was thinking of skipping the check for speed reasons when I did this, but as these two calls can both often happen at as the first actual write to stream, which can have the longest delay waiting for the underlying layer, they should both have the opportunity to cancel. --- Src/Newtonsoft.Json/JsonTextWriter.Async.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Newtonsoft.Json/JsonTextWriter.Async.cs b/Src/Newtonsoft.Json/JsonTextWriter.Async.cs index 3a2910e7..c3b86175 100644 --- a/Src/Newtonsoft.Json/JsonTextWriter.Async.cs +++ b/Src/Newtonsoft.Json/JsonTextWriter.Async.cs @@ -407,7 +407,7 @@ namespace Newtonsoft.Json { await task.ConfigureAwait(false); - await _writer.WriteAsync('[').ConfigureAwait(false); + await _writer.WriteAsync('[', cancellationToken).ConfigureAwait(false); } /// @@ -437,7 +437,7 @@ namespace Newtonsoft.Json { await task.ConfigureAwait(false); - await _writer.WriteAsync('{').ConfigureAwait(false); + await _writer.WriteAsync('{', cancellationToken).ConfigureAwait(false); } ///