Skip to content

[SR-6396] URLSessionConfiguration has isDiscretionary on iOS, discretionary on Linux #4054

@swift-ci

Description

@swift-ci
Previous ID SR-6396
Radar rdar://35551732
Original Reporter p_thompson (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Linux w/ Swift 4

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee iothmane (JIRA)
Priority Medium

md5: 399753fafb226b6f493973bc33872d9f

Issue Description:

When using a URLSessionConfiguration, I expected to be able to set discretionary transfers with .isDiscretionary. On Darwin platforms, this works as expect. On Linux, this field doesn't exist and is instead .discretionary. This seems like a needless difference.

import Foundation
let configuration = URLSessionConfiguration()

let aMirror = Mirror(reflecting: configuration)

for (label, value) in aMirror.children {
print("(label!): (value)")
}

https://swift.sandbox.bluemix.net/#/repl

Swift Ver. 3.1.1 (Release) // repros on orchard with 4.0 too
Platform: Linux (x86_64)

identifier: nil
requestCachePolicy: useProtocolCachePolicy
timeoutIntervalForRequest: 60.0
timeoutIntervalForResource: 604800.0
networkServiceType: default
allowsCellularAccess: true

discretionary: false

connectionProxyDictionary: nil
httpShouldUsePipelining: false
httpShouldSetCookies: true
httpCookieAcceptPolicy: onlyFromMainDocumentDomain
httpAdditionalHeaders: nil
httpMaximumConnectionsPerHost: 6
httpCookieStorage: nil
urlCredentialStorage: nil
urlCache: nil
shouldUseExtendedBackgroundIdleMode: false
protocolClasses: nil

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions