URLSession's various timeouts are weird. tl;dr You should use URLRequest.timeoutInterval on Linux, since it's broken.
To summarize:
URLRequest.timeoutInterval: supposedly the timeout of the initial connection attempt.
URLSessionConfiguration.timeoutIntervalForRequest: timeout for more data after initial connection. So this only applies if the server returns some bytes and it takes more than the interval for addition bytes to arrive.
URLSessionConfiguration.timeoutIntervalForResource: total time to wait for completion, but the docs say the default is 7 days (which is weirdly absurd).
For URLSession on Linux, the only timeout I can see with a 60 second default is URLRequest.timeoutInterval, but that shouldn't really apply once the connection is established, unless the docs are wrong.
Could be.
/// Returns the timeout interval of the receiver.
/// - discussion: The timeout interval specifies the limit on the idle
/// interval allotted to a request in the process of loading. The "idle
/// interval" is defined as the period of time that has passed since the
/// last instance of load activity occurred for a request that is in the
/// process of loading. Hence, when an instance of load activity occurs
/// (e.g. bytes are received from the network for a request), the idle
/// interval for a request is reset to 0. If the idle interval ever
/// becomes greater than or equal to the timeout interval, the request
/// is considered to have timed out. This timeout interval is measured
/// in seconds.
That doesn't seem to be what it's documented to mean on Apple platforms but without access to the source we can't tell. But it also doesn't explain the behavior. How is it used?
//set the request timeout
//TODO: the timeout value needs to be reset on every data transfer
Ah yes, they never actually implemented the documented behavior, so it's just a normal overall timeout. And the values aren't documented to the do the same thing anyway.
Ineed I have experimented with both timeouts.
And at this time I suspect there is something else going on.
The code on the Windows VM uses
#if canImport(FoundationNetworking)
// until we move to swift 6 ...
import FoundationNetworking
#endif
The VM has decent upload speeds (as seen using the speedtest.net). But it always times out after a minute with the large Uploads (> 10MB).
Smaller files upload just fine.
On the same Mac that upload completes in just a few seconds.
So this is indicative of other issues ...