You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 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.
38
-
@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.")
93
+
@available(*, deprecated, message:"swift-corelibs-foundation does not support background 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.")
39
94
openvarearliestBeginDate:Date?=nil
40
95
41
96
/// How many times the task has been suspended, 0 indicating a running task.
@@ -180,6 +235,9 @@ open class URLSessionTask : NSObject, NSCopying {
180
235
self.body = body
181
236
super.init()
182
237
self.currentRequest = request
238
+
self.progress.cancellationHandler ={[weak self]in
239
+
self?.cancel()
240
+
}
183
241
}
184
242
deinit{
185
243
//TODO: Do we remove the EasyHandle from the session here? This might run on the wrong thread / queue.
@@ -238,6 +296,7 @@ open class URLSessionTask : NSObject, NSCopying {
0 commit comments