Skip to content

Commit 8fb4401

Browse files
committed
ipn/yegor: m code comments
1 parent b02f7d1 commit 8fb4401

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

intra/ipn/rpn/yegor.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,6 @@ func skipWsServer(server WsServerList) (bool, string) {
12901290
return false, "" // this server is okay to use
12911291
}
12921292

1293-
// TODO: For now, hardcode to use 443 (at pos 0) or 53 (at pos 1) as it has better "anti-censorship" property.
12941293
func wsRandomPort() string {
12951294
// return a random port from the list of WireGuard ports
12961295
// return wswgports[rand.Int32N(int32(len(wswgports)))]
@@ -1982,13 +1981,11 @@ func listKeys(h *http.Client, ent *WsEntitlement, bearer string) (*WsWgListKeysR
19821981

19831982
// createPermaCreds calls POST WgConfigs/permanent to create a permanent WG config.
19841983
// If pubkey is empty the server generates both the private and public keys.
1985-
func createPermaCreds(h *http.Client, ent *WsEntitlement, bearer, port, pubkey string) (*WsWgPermanentConfig, error) {
1984+
func createPermaCreds(h *http.Client, ent *WsEntitlement, bearer, pubkey string) (*WsWgPermanentConfig, error) {
19861985
if len(bearer) <= 0 {
19871986
return nil, errWsNoToken
19881987
}
1989-
if len(port) <= 0 {
1990-
port = wsRandomPort() // some port; doesn't matter which one
1991-
}
1988+
port := wsRandomPort() // some port; doesn't matter which one
19921989
tokst := tokenState(bearer)
19931990

19941991
// curl --location --request POST '.../WgConfigs/permanent' \
@@ -2078,7 +2075,7 @@ func getOrCreatePermaCreds(h *http.Client, sess *WsSession, ent *WsEntitlement,
20782075
}
20792076

20802077
// no public key matches or no existing creds
2081-
return createPermaCreds(h, ent, bearer, "443", "" /*no pubkey – server generates keypair*/)
2078+
return createPermaCreds(h, ent, bearer, "" /*server generates keypair*/)
20822079
}
20832080

20842081
func wsBriefPauseBeforeRetry() {

0 commit comments

Comments
 (0)