From 31fa9195a141a8388d4d0c590f0425d4abd0a385 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Sun, 20 Dec 2020 17:01:38 +0100 Subject: [PATCH] Bugfix --- src/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client.c b/src/client.c index f29b868..975c304 100644 --- a/src/client.c +++ b/src/client.c @@ -45,6 +45,7 @@ int client_request_handler(sock *client, int req_num) { char *host, *hdr_connection, *webroot; unsigned long content_length = 0; FILE *file = NULL; + msg_buf[0] = 0; http_res res; sprintf(res.version, "1.1"); @@ -223,7 +224,7 @@ int client_request_handler(sock *client, int req_num) { if (strncmp(req.method, "HEAD", 4) != 0) { unsigned long snd_len = 0; unsigned long len = 0; - if (res.status->code >= 400 && res.status->code < 600) { + if (msg_buf[0] != 0) { while (snd_len < content_length) { if (client->enc) { ret = SSL_write(client->ssl, msg_buf, (int) (content_length - snd_len));