QUOTE: Life is a journey, not a destination.

fix: Fixed write on closed socket bug - libhttp - A basic HTTP Framework

libhttp

A basic HTTP Framework
git clone git://192.168.2.2/libhttp
Log | Files | Refs | README

commit 00aab001e40379f130096573da5c723ef5ff5bd7
parent 19a49f2cf958511c067e1139537b1835631b62e3
Author: typable <contact@typable.dev>
Date:   Mon,  6 May 2024 11:04:37 +0200

fix: Fixed write on closed socket bug

Diffstat:
Mlibhttp.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/libhttp.c b/libhttp.c @@ -7,6 +7,7 @@ #include <netdb.h> #include <errno.h> #include <poll.h> +#include <signal.h> #include <openssl/ssl.h> #include "libhttp.h" @@ -509,6 +510,7 @@ void http_tls_enable(char *certificate, char *private_key) { } void http_listen(char *hostname, int port) { + signal(SIGPIPE, SIG_IGN); if (http_error) { return; }