From 25d0482fced2585eec4acf2a5bbc73ad70df8002 Mon Sep 17 00:00:00 2001 From: Uri Yagelnik Date: Sun, 28 Jul 2024 07:57:06 +0000 Subject: [PATCH] Fix bug in writeToClient Signed-off-by: Uri Yagelnik --- src/networking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/networking.c b/src/networking.c index 13b76a0893..915a0b016f 100644 --- a/src/networking.c +++ b/src/networking.c @@ -2092,7 +2092,7 @@ int _writeToClient(client *c) { ssize_t tot_written = 0; while (tot_written < bytes_to_write) { - int nwritten = connWrite(c->conn, c->buf + c->sentlen, bytes_to_write - tot_written); + int nwritten = connWrite(c->conn, c->buf + c->sentlen + tot_written, bytes_to_write - tot_written); if (nwritten <= 0) { c->write_flags |= WRITE_FLAGS_WRITE_ERROR; tot_written = tot_written > 0 ? tot_written : nwritten;