源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
This commit is contained in:
commit
2ed3415fb7
8018 files changed
+1936476
No files matched your search
@@ -0,0 +1,42 @@
|
||||
#import "DeviceLinkRelayProbe.h"
|
||||
|
||||
static NSError *TUTRelayProbeError(NSString *message) {
|
||||
return [NSError errorWithDomain:@"sh.tutti.mobile.device-link.relay-probe"
|
||||
code:1
|
||||
userInfo:@{NSLocalizedDescriptionKey : message}];
|
||||
}
|
||||
|
||||
void TUTDeviceLinkProbeRelay(
|
||||
NSDictionary *relay, int64_t timeoutMillis, dispatch_queue_t queue,
|
||||
TUTDeviceLinkRelayRequest request,
|
||||
TUTDeviceLinkRelayProbeCompletion completion) {
|
||||
dispatch_async(queue, ^{
|
||||
NSError *error = nil;
|
||||
TUTMobileStream *stream = TUTMobileDialRelay(
|
||||
relay[@"endpoint"], relay[@"queryJSON"], relay[@"headersJSON"],
|
||||
relay[@"subprotocol"], timeoutMillis, &error);
|
||||
NSDictionary *response = nil;
|
||||
if (stream != nil && error == nil) {
|
||||
response = request(stream, timeoutMillis, &error);
|
||||
}
|
||||
if (response == nil || error != nil) {
|
||||
completion(error ?: TUTRelayProbeError(@"Relay peer handshake failed"));
|
||||
return;
|
||||
}
|
||||
NSNumber *protocolEpoch = response[@"protocolEpoch"];
|
||||
if (![protocolEpoch isKindOfClass:[NSNumber class]] ||
|
||||
protocolEpoch.longLongValue != TUTMobileProtocolEpoch()) {
|
||||
completion(TUTRelayProbeError(
|
||||
@"Relay peer uses an unsupported DeviceLink protocol epoch"));
|
||||
return;
|
||||
}
|
||||
NSInteger status = [response[@"status"] integerValue];
|
||||
if (status < 200 || status > 299) {
|
||||
completion(TUTRelayProbeError([NSString stringWithFormat:
|
||||
@"Relay peer control request returned HTTP %ld",
|
||||
(long)status]));
|
||||
return;
|
||||
}
|
||||
completion(nil);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user