Skip to content

Commit

Permalink
Network: Use private log property in SocketListener instead of IRCd p…
Browse files Browse the repository at this point in the history
…roperty.

task: #12
  • Loading branch information
lewishazell committed May 23, 2021
1 parent cbb9dcb commit cb236d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmpctircd/SocketListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public virtual void Bind() {
}
public virtual void Stop() {
if (_started) {
_ircd.Log.Debug($"Shutting down listener [IP: {Info.Host}, Port: {Info.Port}, TLS: {Info.IsTls}]");
log.Debug($"Shutting down listener [IP: {Info.Host}, Port: {Info.Port}, TLS: {Info.IsTls}]");
_listener.Stop();
_started = false;
}
Expand All @@ -63,7 +63,7 @@ public async Task ListenToClients() {
TcpClient tc = await _listener.AcceptTcpClientAsync();
HandleClientAsync(tc); // this should split off execution
} catch(Exception e) {
_ircd.Log.Error($"Exception in ListenToClients(): {e.ToString()}");
log.Error($"Exception in ListenToClients(): {e.ToString()}");
}
}
}
Expand All @@ -74,7 +74,7 @@ protected async Task<Stream> HandshakeIfNeededAsync(TcpClient tc, Stream stream)
try {
stream = await HandshakeTlsAsServerAsync(tc);
} catch (Exception e) {
_ircd.Log.Debug($"Exception in {nameof(HandshakeTlsAsServerAsync)}: {e}");
log.Debug($"Exception in {nameof(HandshakeTlsAsServerAsync)}: {e}");
tc.Close();
}
}
Expand Down Expand Up @@ -191,7 +191,7 @@ public async Task<SslStream> HandshakeTlsAsClient(TcpClient tc, string host, boo
if (verifyCert) {
stream = new SslStream(tc.GetStream(), true);
} else {
_ircd.Log.Warn($"[SERVER] Connecting out to server {host} with TLS verification disabled: this is dangerous!");
log.Warn($"[SERVER] Connecting out to server {host} with TLS verification disabled: this is dangerous!");
stream = new SslStream(tc.GetStream(), true, (sender, certificate, chain, sslPolicyErrors) => true);
}

Expand Down

0 comments on commit cb236d4

Please sign in to comment.