tFlush stdout when serving robots.txt - phroxy - Gopher to HTTP proxy
 (HTM) git clone git://git.z3bra.org/phroxy.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 9fa1fb8dd2878aa7c776117bb35257010477ab72
 (DIR) parent 7b716aa8cb5087d707b16615ffdaeedb930a5bcc
 (HTM) Author: Willy Goiffon <dev@z3bra.org>
       Date:   Mon, 20 Sep 2021 14:31:28 +0200
       
       Flush stdout when serving robots.txt
       
       Diffstat:
         M phroxy.c                            |       6 +++++-
       
       1 file changed, 5 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/phroxy.c b/phroxy.c
       t@@ -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;
        }
        
       t@@ -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++;