Skip to content
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

Add Multipath TCP (MPTCP) support #5848

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SignalServiceKit/Network/ContentProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class ContentProxy: NSObject {
"HTTPSProxy": proxyHost,
"HTTPSPort": proxyPort
]
configuration.multipathServiceType = .handover
return configuration
}

Expand Down
5 changes: 4 additions & 1 deletion SignalServiceKit/Network/OWSUrlSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,16 @@ public class OWSURLSession: NSObject, OWSURLSessionProtocol {
}

public static var defaultConfigurationWithCaching: URLSessionConfiguration {
.ephemeral
let configuration = URLSessionConfiguration.ephemeral
configuration.multipathServiceType = .handover
return configuration
}

public static var defaultConfigurationWithoutCaching: URLSessionConfiguration {
let configuration = URLSessionConfiguration.ephemeral
configuration.urlCache = nil
configuration.requestCachePolicy = .reloadIgnoringLocalCacheData
configuration.multipathServiceType = .handover
return configuration
}

Expand Down
8 changes: 7 additions & 1 deletion SignalServiceKit/Subscriptions/Stripe.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,17 @@ fileprivate extension Stripe {
: "pk_test_sngOd8FnXNkpce9nPXawKrJD00kIDngZkD"

static let authorizationHeader = "Basic \(Data("\(publishableKey):".utf8).base64EncodedString())"

static let configuration: URLSessionConfiguration{
let configuration = URLSessionConfiguration.ephemeral
configuration.multipathServiceType = .handover
return configuration
}

static let urlSession = OWSURLSession(
baseUrl: URL(string: "https://api.stripe.com/v1/")!,
securityPolicy: OWSURLSession.defaultSecurityPolicy,
configuration: URLSessionConfiguration.ephemeral
configuration: configuration
)

struct API {
Expand Down
1 change: 1 addition & 0 deletions SignalUI/LinkPreview/LinkPreviewFetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public class LinkPreviewFetcherImpl: LinkPreviewFetcher {
let sessionConfig = URLSessionConfiguration.ephemeral
sessionConfig.urlCache = nil
sessionConfig.requestCachePolicy = .reloadIgnoringLocalCacheData
sessionConfig.multipathServiceType = .handover

// Twitter doesn't return OpenGraph tags to Signal
// `curl -A Signal "https://twitter.com/signalapp/status/1280166087577997312?s=20"`
Expand Down
1 change: 1 addition & 0 deletions SignalUI/Payments/MobileCoinAPI+Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ final class MobileCoinHttpRequester: NSObject, HttpRequester {
let config = URLSessionConfiguration.default
config.timeoutIntervalForRequest = 30
config.timeoutIntervalForResource = 30
config.multipathServiceType = .handover
return config
}()

Expand Down