Skip to content

Commit c327174

Browse files
authored
Merge pull request #591 from microsoftgraph/andrueastman/fixoverallTimeout
Disables WinHttpHandler internal timeouts(Kiota)
2 parents f795cce + 2bfe210 commit c327174

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
<AssemblyOriginatorKeyFile>35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
2222
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
2323
<VersionPrefix>3.0.0</VersionPrefix>
24-
<VersionSuffix>rc.5</VersionSuffix>
24+
<VersionSuffix>rc.6</VersionSuffix>
2525
<PackageReleaseNotes>
26-
- Use ConcurrentDictionary for the serialization registries.
26+
- Fixes inability to set OverallTimeout when the WinHttpHandler is used by the client.
2727
</PackageReleaseNotes>
2828
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2929
<EmbedUntrackedSources>true</EmbedUntrackedSources>

src/Microsoft.Graph.Core/Requests/GraphClientFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace Microsoft.Graph
99
using System.Net;
1010
using System.Net.Http;
1111
using System.Net.Http.Headers;
12+
using System.Threading;
1213
using Microsoft.Kiota.Http.HttpClientLibrary;
1314
using Microsoft.Kiota.Http.HttpClientLibrary.Middleware;
1415

@@ -224,7 +225,7 @@ internal static HttpMessageHandler GetNativePlatformHttpHandler(IWebProxy proxy
224225
// If custom proxy is passed, the WindowsProxyUsePolicy will need updating
225226
// https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs#L575
226227
var proxyPolicy = proxy != null ? WindowsProxyUsePolicy.UseCustomProxy : WindowsProxyUsePolicy.UseWinHttpProxy;
227-
return new WinHttpHandler { Proxy = proxy, AutomaticDecompression = DecompressionMethods.None , WindowsProxyUsePolicy = proxyPolicy };
228+
return new WinHttpHandler { Proxy = proxy, AutomaticDecompression = DecompressionMethods.None , WindowsProxyUsePolicy = proxyPolicy, SendTimeout = Timeout.InfiniteTimeSpan, ReceiveDataTimeout = Timeout.InfiniteTimeSpan, ReceiveHeadersTimeout = Timeout.InfiniteTimeSpan };
228229
#elif NET6_0_OR_GREATER
229230
//use resilient configs when we can https://learn.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-5.0#alternatives-to-ihttpclientfactory-1
230231
return new SocketsHttpHandler { Proxy = proxy, AllowAutoRedirect = false, AutomaticDecompression = DecompressionMethods.None, PooledConnectionLifetime = TimeSpan.FromMinutes(1)};

src/Microsoft.Graph.Core/Tasks/LargeFileUploadTask.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public async Task<UploadResult<T>> UploadAsync(IProgress<long> progress = null,
187187
{
188188
var uploadResult = await this.UploadSliceAsync(request, trackedExceptions, cancellationToken).ConfigureAwait(false);
189189

190-
progress?.Report(request.RangeBegin);//report the progress of upload
190+
progress?.Report(request.RangeEnd);//report the progress of upload (how many bytes have been uploaded so far)
191191

192192
if (uploadResult.UploadSucceeded)
193193
{

0 commit comments

Comments
 (0)