Skip to content

Commit 44f8738

Browse files
authored
Merge pull request #2295 from millenomi/urlsessiontask-earliestbegindate
2 parents 6796e9b + a041925 commit 44f8738

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Foundation/URLSession/URLSessionTask.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ import CoreFoundation
2626
/// of processing a given request.
2727
open class URLSessionTask : NSObject, NSCopying {
2828

29-
public var countOfBytesClientExpectsToReceive: Int64 = NSURLSessionTransferSizeUnknown
30-
public var countOfBytesClientExpectsToSend: Int64 = NSURLSessionTransferSizeUnknown
31-
public var earliestBeginDate: Date? { NSUnimplemented() }
29+
// These properties aren't heeded in swift-corelibs-foundation, but we may heed them in the future. They exist for source compatibility.
30+
open var countOfBytesClientExpectsToReceive: Int64 = NSURLSessionTransferSizeUnknown
31+
open var countOfBytesClientExpectsToSend: Int64 = NSURLSessionTransferSizeUnknown
32+
33+
// We're not going to heed this one. If someone is setting it in Linux code, they may be relying on behavior that isn't there; warn.
34+
@available(*, deprecated, message: "swift-corelibs-foundation does not support URLSession instances, and this property is documented to have no effect when set on tasks created from non-background URLSession instances. Modifying this property has no effect in swift-corelibs-foundation and shouldn't be relied upon; resume tasks at the appropriate time instead.")
35+
open var earliestBeginDate: Date? = nil
3236

3337
/// How many times the task has been suspended, 0 indicating a running task.
3438
internal var suspendCount = 1

0 commit comments

Comments
 (0)