1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-12 14:10:31 +08:00

TUN-2309: Split ConnectResult into ConnectError and ConnectSuccess, each implementing its own capnp serialization logic

This commit is contained in:
Chung-Ting Huang
2019-09-17 16:58:49 -05:00
parent 4f23da2a6d
commit 5bcb2da0fe
6 changed files with 564 additions and 315 deletions

View File

@@ -62,11 +62,10 @@ struct CapnpConnectParameters {
}
struct ConnectResult {
err @0 :ConnectError;
# Information about the server this connection is established with
serverInfo @1 :ServerInfo;
# How this cloudflared instance should be configured
clientConfig @2 :ClientConfig;
result :union {
err @0 :ConnectError;
success @1 :ConnectSuccess;
}
}
struct ConnectError {
@@ -76,6 +75,13 @@ struct ConnectError {
shouldRetry @2 :Bool;
}
struct ConnectSuccess {
# Information about the server this connection is established with
serverLocationName @0 :Text;
# How this cloudflared instance should be configured. This can be null if there isn't an intent for this origin yet
clientConfig @1 :ClientConfig;
}
struct ClientConfig {
# Version of this configuration. This value is opaque, but is guaranteed
# to monotonically increase in value. Any configuration supplied to