mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 00:26:07 +02:00
feat: improve IRC command handling with debug logging for incoming messages
This commit is contained in:
@@ -44,8 +44,9 @@ public sealed class IrcClientConnection : IAsyncDisposable
|
|||||||
public IrcClientConnection(TcpClient tcpClient, Stream stream)
|
public IrcClientConnection(TcpClient tcpClient, Stream stream)
|
||||||
{
|
{
|
||||||
_tcpClient = tcpClient;
|
_tcpClient = tcpClient;
|
||||||
_reader = new StreamReader(stream, Encoding.UTF8);
|
var utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
|
||||||
_writer = new StreamWriter(stream, Encoding.UTF8) { AutoFlush = true, NewLine = "\r\n" };
|
_reader = new StreamReader(stream, utf8NoBom);
|
||||||
|
_writer = new StreamWriter(stream, utf8NoBom) { AutoFlush = true, NewLine = "\r\n" };
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<string?> ReadLineAsync(CancellationToken ct)
|
public async Task<string?> ReadLineAsync(CancellationToken ct)
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ public sealed class IrcCommandHandler
|
|||||||
line = line.TrimEnd('\r', '\n');
|
line = line.TrimEnd('\r', '\n');
|
||||||
if (string.IsNullOrWhiteSpace(line)) continue;
|
if (string.IsNullOrWhiteSpace(line)) continue;
|
||||||
|
|
||||||
|
_logger.LogDebug("IRC < {Id}: {Line}", _conn.ConnectionId, line);
|
||||||
|
|
||||||
var msg = IrcMessage.Parse(line);
|
var msg = IrcMessage.Parse(line);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user