Browse Source

Fix: record relay_protocol in pre-handshake cases

Rod Hynes 7 years ago
parent
commit
8be8510712
1 changed files with 6 additions and 0 deletions
  1. 6 0
      psiphon/server/tunnelServer.go

+ 6 - 0
psiphon/server/tunnelServer.go

@@ -1976,6 +1976,12 @@ func (sshClient *sshClient) logTunnel(additionalMetrics []LogFields) {
 		sshClient.handshakeState.apiParams,
 		baseRequestParams)
 
+	// "relay_protocol" is sent with handshake API parameters. In pre-
+	// handshake logTunnel cases, this value is not yet known. As
+	// sshClient.tunnelProtocol is authoritative, set this value
+	// unconditionally, overwriting any value from handshake.
+	logFields["relay_protocol"] = sshClient.tunnelProtocol
+
 	logFields["session_id"] = sshClient.sessionID
 	logFields["handshake_completed"] = sshClient.handshakeState.completed
 	logFields["start_time"] = sshClient.activityConn.GetStartTime()