3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-26 12:42:50 +01:00

Merge pull request #1034 from slingamn/rename

correct old proxiedConn name
This commit is contained in:
Shivaram Lingamneni 2020-05-19 06:40:24 -07:00 committed by GitHub
commit b94e7ea985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,20 +265,20 @@ type ClientDetails struct {
// RunClient sets up a new client and runs its goroutine.
func (server *Server) RunClient(conn IRCConn) {
proxiedConn := conn.UnderlyingConn()
wConn := conn.UnderlyingConn()
var isBanned bool
var banMsg string
realIP := utils.AddrToIP(proxiedConn.RemoteAddr())
realIP := utils.AddrToIP(wConn.RemoteAddr())
var proxiedIP net.IP
if proxiedConn.Config.Tor {
if wConn.Config.Tor {
// cover up details of the tor proxying infrastructure (not a user privacy concern,
// but a hardening measure):
proxiedIP = utils.IPv4LoopbackAddress
isBanned, banMsg = server.checkTorLimits()
} else {
ipToCheck := realIP
if proxiedConn.ProxiedIP != nil {
proxiedIP = proxiedConn.ProxiedIP
if wConn.ProxiedIP != nil {
proxiedIP = wConn.ProxiedIP
ipToCheck = proxiedIP
}
isBanned, banMsg = server.checkBans(ipToCheck)
@ -303,7 +303,7 @@ func (server *Server) RunClient(conn IRCConn) {
lastActive: now,
channels: make(ChannelSet),
ctime: now,
isSTSOnly: proxiedConn.Config.STSOnly,
isSTSOnly: wConn.Config.STSOnly,
languages: server.Languages().Default(),
loginThrottle: connection_limits.GenericThrottle{
Duration: config.Accounts.LoginThrottling.Duration,
@ -329,7 +329,7 @@ func (server *Server) RunClient(conn IRCConn) {
lastActive: now,
realIP: realIP,
proxiedIP: proxiedIP,
isTor: proxiedConn.Config.Tor,
isTor: wConn.Config.Tor,
}
client.sessions = []*Session{session}
@ -337,13 +337,13 @@ func (server *Server) RunClient(conn IRCConn) {
session.resetFakelag()
ApplyUserModeChanges(client, config.Accounts.defaultUserModes, false, nil)
if proxiedConn.Secure {
if wConn.Secure {
client.SetMode(modes.TLS, true)
}
if proxiedConn.Config.TLSConfig != nil {
if wConn.Config.TLSConfig != nil {
// error is not useful to us here anyways so we can ignore it
session.certfp, _ = utils.GetCertFP(proxiedConn.Conn, RegisterTimeout)
session.certfp, _ = utils.GetCertFP(wConn.Conn, RegisterTimeout)
}
if session.isTor {
@ -351,7 +351,7 @@ func (server *Server) RunClient(conn IRCConn) {
client.rawHostname = session.rawHostname
} else {
if config.Server.CheckIdent {
client.doIdentLookup(proxiedConn.Conn)
client.doIdentLookup(wConn.Conn)
}
}