-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Merge the main branch into package #4977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CURL documentation (https://curl.se/libcurl/c/CURLMOPT_TIMERFUNCTION.html) explicitly says that the timer should be one-time. We basically have to follow CURL requests for setting, resetting and disarming such timers. Current logic eventually leaves a 1ms repeating timer forever, because CURL assumes it fires once, and may not ask us to remove it explicitly. Also, being used as request timeout trigger, this timer also has no sense to be repeated.
Extends socket lifetime enough to let DispatchSource cancel properly. Also prevents from creating new DispatchSources while other are in the middle of cancelling. Also includes tests (see swiftlang#4854 for test details).
Fixes swiftlang/swift#73532. On Windows, socket handles in a `fd_set` are not represented as bit flags as in Berkeley sockets. While we have no `fd_set` dynamic growth in this implementation, the `FD_SETSIZE` defined as 1024 in `CoreFoundation_Prefix.h` should be enough for majority of tasks.
…patchsource-close
[Windows] Use `fd_set` according to Winsock2 specifics
* Add `data(from:delegate:)` method. * Add async URLSession methods --------- Co-authored-by: ichiho <[email protected]>
[wasm] Do not set permissions in `Data.write`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -666,6 +682,231 @@ internal extension URLSession { | |||
} | |||
} | |||
|
|||
fileprivate struct Lock<State>: @unchecked Sendable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't have to be a part of this PR, but maybe we should expose FoundationEssentials.LockedState
as @_spi
to avoid inventing yet another lock type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll soon be able to use Mutex
anyway.
Incorporate latest updates from
main
intopackage
.