Skip to content

Commit 61709c6

Browse files
committed
Merge branch 'dev/v3.10.x' into freezed
2 parents 399c290 + 2e33526 commit 61709c6

File tree

4 files changed

+7
-86
lines changed

4 files changed

+7
-86
lines changed
1.5 KB
Binary file not shown.

Assets/PatchKit Patcher/Scripts/AppData/Remote/Downloaders/BaseHttpDownloader.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.IO;
33
using System.Net;
44
using JetBrains.Annotations;
@@ -79,7 +79,8 @@ public void Download(CancellationToken cancellationToken)
7979
{
8080
Address = new Uri(_url),
8181
Range = _bytesRange,
82-
Timeout = _timeout
82+
Timeout = _timeout,
83+
ReadWriteTimeout = _timeout,
8384
};
8485

8586
using (var response = _httpClient.Get(request))

Assets/PatchKit Patcher/Scripts/Utilities/BytesRangeHelpers.cs

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -54,89 +54,5 @@ public static BytesRange Chunkify(this BytesRange range, ChunksData chunksData)
5454

5555
return new BytesRange(bottom, top);
5656
}
57-
58-
/// <summary>
59-
/// Limits one range inside the other, examples:
60-
/// 0:-1 contained in range 20:30 becomes 20:30.
61-
/// 0:100 contained in range 50:-1 becomes 50:100
62-
/// </summary>
63-
public static BytesRange ContainIn(this BytesRange range, BytesRange outer)
64-
{
65-
if (Contains(outer, range))
66-
{
67-
return range;
68-
}
69-
70-
long start = range.Start;
71-
long end = range.End;
72-
73-
if (range.Start < outer.Start)
74-
{
75-
start = outer.Start;
76-
}
77-
78-
if (outer.End != -1)
79-
{
80-
if (range.End == -1 || range.End > outer.End)
81-
{
82-
end = outer.End;
83-
}
84-
}
85-
86-
return Make(start, end);
87-
}
88-
89-
/// <summary>
90-
/// Localizes one range inside another, the resulting range is limited and local to the relative ("parent") range
91-
/// If the ranges don't overlap, an empty range will be returned.
92-
/// Examples:
93-
/// 50:95 localized within 10:90 becomes 40:-1
94-
/// 5:15 localized within 10:90 becomes 0:5
95-
/// </summary>
96-
public static BytesRange LocalizeTo(this BytesRange range, BytesRange relative)
97-
{
98-
if (!Overlaps(range, relative))
99-
{
100-
return Empty();
101-
}
102-
103-
long localStart = range.Start >= relative.Start ? range.Start - relative.Start : 0;
104-
long localEnd = range.End <= relative.End ? range.End - relative.Start : -1;
105-
106-
if (range.End == -1)
107-
{
108-
localEnd = -1;
109-
}
110-
111-
return Make(localStart, localEnd);
112-
}
113-
114-
public static bool Overlaps(this BytesRange lhs, BytesRange rhs)
115-
{
116-
return Contains(lhs, rhs)
117-
|| Contains(rhs, lhs)
118-
|| Contains(lhs, rhs.Start)
119-
|| Contains(lhs, rhs.End);
120-
}
121-
122-
public static bool Contains(this BytesRange outer, BytesRange inner)
123-
{
124-
if (inner.End == -1 && outer.End != -1)
125-
{
126-
return false;
127-
}
128-
129-
if (inner.Start >= outer.Start)
130-
{
131-
return outer.End == -1 || inner.End <= outer.End;
132-
}
133-
134-
return false;
135-
}
136-
137-
public static bool Contains(this BytesRange range, long value)
138-
{
139-
return value >= range.Start && (range.End == -1 || value <= range.End);
140-
}
14157
}
14258
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [Unreleased]
8+
### Changed
9+
- Patcher will timeout if the downloading stopped sooner than after 5 minutes
10+
711
## [3.10.1]
812
### Fixed
913
- Updated torrent-client to fix the issue with paths with spaces in them

0 commit comments

Comments
 (0)