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
FoundationNetworking: Split networking into its own module
This patch introduces a new module, FoundationNetworking, which will include all classes related to loading from remote URLs. Several types have been moved to that module, which downstream clients must import explicitly, e.g.:
```
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
```
- Split the CFURLSessionInterface files out of Core Foundation and into their own library, libCFURLSessionInterface. This is produced by the CF CMakeLists.txt file on non-Darwin platforms. Just like CF, we strongly discourage linking to this library directly.
- Split URLSession and related classes (except for URL and URLComponents) into a new FoundationNetworking module (SwiftFoundationNetworking on Darwin). Note:
1. The features in Boxing.swift are needed to both modules. This file is compiled separately in both modules, and relies on a NS_BUILDING_FOUNDATION_NETWORKING compilation condition to compile correctly in FoundationNetworking
2. SPI that was used in InputStream is now available through a public struct named _InputStreamSPIForFoundationNetworkingUseOnly for FoundationNetworking to use. This isn’t API, much like _ObjectiveCBridgeable.
Also:
- Change some details to make tests fail without a fatal error for issues that aren’t programmer errors.
- In some circumstances, CURL can set an immediate timeout reentrantly if the timeout callback invokes CURL hooks. Always dispatch the CURL hook call asynchronously from a request for an immediate timeout.
- Types that have a `contentsOf url: URL` initializer can still accept non-file: URLs if FoundationNetworking is available in the address space of the current process (if it has been linked or dynamically loaded, for example). Loading non-file: URLs without this will result in a fatal error. Loading file: URLs will always succeed even in the absence of FoundationNetworking.
0 commit comments