phroxy

Gopher to HTTP proxy
git clone git://git.z3bra.org/phroxy.git
Log | Files | Refs | LICENSE

commit 9fa1fb8dd2878aa7c776117bb35257010477ab72
parent 7b716aa8cb5087d707b16615ffdaeedb930a5bcc
Author: Willy Goiffon <dev@z3bra.org>
Date:   Mon, 20 Sep 2021 14:31:28 +0200

Flush stdout when serving robots.txt

Diffstat:
Mphroxy.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/phroxy.c b/phroxy.c @@ -374,8 +374,12 @@ servebots() { printf("HTTP/1.1 200 OK\r\n"); printheaders("text/plain"); + printf("Content-Length: %ld\r\n", strlen(robotstxt)); printf("\r\n"); + fflush(stdout); write(1, robotstxt, strlen(robotstxt)); + fflush(stdout); + return 0; } @@ -450,7 +454,7 @@ phroxy(char *url) char *hole, *path, *host, *port; char *data = NULL, *srch = NULL; - if (!strncmp(url, "/robots.txt", 10)) + if (!strncmp(url, "/robots.txt", 11)) return servebots(); url++;