Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9da59a0

Browse files
committed
update VPN protocol version; fmt & lint
1 parentfdcf9c3 commit9da59a0

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

‎Coder-Desktop/VPNLib/Speaker.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ public actor Speaker<SendMsg: RPCMessage & Message, RecvMsg: RPCMessage & Messag
8989
/// Does the VPN Protocol handshake and validates the result
9090
publicfunc handshake()asyncthrows(HandshakeError){
9191
lethndsh=Handshaker(writeFD: writeFD, dispatch: dispatch, queue: queue, role: role)
92-
// ignore the version for now because we know it can only be 1.0
92+
// ignore the version for now because we know it can only be 1.0 or 1.1.
93+
// 1.1 adds support for telemetry to StartRequest, but since setting these
94+
// fields won't adversely affect a 1.0 speaker, we set them regardless.
9395
try _=await hndsh.handshake()
9496
}
9597

@@ -178,7 +180,7 @@ actor Handshaker {
178180

179181
init(writeFD: FileHandle, dispatch: DispatchIO, queue: DispatchQueue,
180182
role: ProtoRole,
181-
versions:[ProtoVersion]=[.init(1,0)])
183+
versions:[ProtoVersion]=[.init(1,1)])
182184
{
183185
self.writeFD= writeFD
184186
self.dispatch= dispatch

‎Coder-Desktop/VPNLib/TelemetryEnricher.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public struct TelemetryEnricher {
2323
varreq= original
2424
req.deviceOs="macOS"
2525
req.deviceID= deviceID
26-
ifversion!=nil{
27-
req.coderDesktopVersion= version!
26+
iflet version{
27+
req.coderDesktopVersion= version
2828
}
2929
return req
3030
}

‎Coder-Desktop/VPNLibTests/SpeakerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct SpeakerTests: Sendable {
3636
@Testfunc handshake()asyncthrows{
3737
asyncletv= handshaker.handshake()
3838
tryawait uut.handshake()
39-
#expect(tryawait v==ProtoVersion(1,0))
39+
#expect(tryawait v==ProtoVersion(1,1))
4040
}
4141

4242
@Testfunc handleSingleMessage()asyncthrows{

‎Coder-Desktop/VPNLibTests/TelemetryEnricherTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct TelemetryEnricherTests {
1616
#expect(try enriched.coderDesktopVersion.contains(Regex(#"^\d+\.\d+\.\d+$"#)))
1717
letdeviceID= enriched.deviceID
1818
#expect(!deviceID.isEmpty)
19-
19+
2020
// check we get the same deviceID from a new enricher
2121
letenricher1=TelemetryEnricher()
2222
enriched= enricher1.enrich(original)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp