]> PatchyGit - patchyircd.git/commitdiff
move server logging to sendbuf
authorEgor <egor@patchysicp.xyz>
Thu, 25 Jan 2024 02:29:54 +0000 (04:29 +0200)
committerEgor <egor@patchysicp.xyz>
Thu, 25 Jan 2024 02:43:37 +0000 (04:43 +0200)
src/irc.c
src/net.c

index 25ba04e..6801c3c 100644 (file)
--- a/src/irc.c
+++ b/src/irc.c
@@ -10,6 +10,7 @@ map_t autojoin = {0};
 
 const char *hostname = IRCDHOSTNAME;
 void sendbuf(struct client_data *client) {
+       fprintf(stderr, "SERVER %"PRISocket": %.*s", client->FD, (int)databuf.len, (char*)databuf.buf);
        sendClient(client, databuf.buf, databuf.len);
 }
 void chanlog_time(time_t timestamp) {
index 1556060..7d471d9 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -215,7 +215,6 @@ static int sendClientRaw(struct client_data *cl, const char *buf, size_t len)
        cl->want_write_for_write = 0;
        if (cl->FD == (SOCKET)INVALID_SOCKET)
                return 0;
-       fprintf(stderr, "SERVER %"PRISocket": %.*s", cl->FD, (int)len, (char*)buf);
 #ifdef HAS_TLS
        if (cl->cctx) {
                while (len) {