Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Todd Menier 2019-01-19 09:30:43 -06:00
commit 5475393639
4 changed files with 38 additions and 3 deletions

10
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,10 @@
---
name: Bug report
about: Report an error or (likely) unintended behavior in the library
title: ''
labels: bug
assignees: ''
---
Please provide a complete description of the bug and a code sample (or better yet, a unit test) that reproduces it.

View File

@ -0,0 +1,10 @@
---
name: Feature request
about: Suggest an idea for a new feature or enhancement
title: ''
labels: enhancement
assignees: ''
---
Please describe the feature/enhancement in as much detail as possible.

View File

@ -0,0 +1,12 @@
---
name: General questions
about: Ask a general, non-programming question about the library
title: ''
labels: ''
assignees: ''
---
If you have a specific programming question, please ask on Stack Overflow. It will be answered more quickly and reach a broader audience. Thanks!
https://stackoverflow.com/questions/ask?tags=flurl

View File

@ -117,11 +117,12 @@ namespace Flurl.Http
request.RequestUri = Url.ToUri(); // in case it was modified in the handler above
var cancellationTokenWithTimeout = cancellationToken;
CancellationTokenSource timeoutTokenSource = null;
if (Settings.Timeout.HasValue) {
var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
cts.CancelAfter(Settings.Timeout.Value);
cancellationTokenWithTimeout = cts.Token;
timeoutTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
timeoutTokenSource.CancelAfter(Settings.Timeout.Value);
cancellationTokenWithTimeout = timeoutTokenSource.Token;
}
call.StartedUtc = DateTime.UtcNow;
@ -146,6 +147,8 @@ namespace Flurl.Http
}
finally {
request.Dispose();
timeoutTokenSource?.Dispose();
if (Settings.CookiesEnabled)
ReadResponseCookies(call.Response);