itFlush stdout after HTTP headers - phroxy - Gopher to HTTP proxy Err z3bra.org 70 hgit clone git://git.z3bra.org/phroxy.git URL:git://git.z3bra.org/phroxy.git z3bra.org 70 1Log /scm/phroxy/log.gph z3bra.org 70 1Files /scm/phroxy/files.gph z3bra.org 70 1Refs /scm/phroxy/refs.gph z3bra.org 70 1LICENSE /scm/phroxy/file/LICENSE.gph z3bra.org 70 i--- Err z3bra.org 70 1commit de16181ef04c64ba57523496ec68b02354505525 /scm/phroxy/commit/de16181ef04c64ba57523496ec68b02354505525.gph z3bra.org 70 1parent ef2d71ffb25c671f716109b8d9bb640fd0a5a9c4 /scm/phroxy/commit/ef2d71ffb25c671f716109b8d9bb640fd0a5a9c4.gph z3bra.org 70 hAuthor: Willy Goiffon URL:mailto:dev@z3bra.org z3bra.org 70 iDate: Thu, 24 Sep 2020 09:56:42 +0200 Err z3bra.org 70 i Err z3bra.org 70 iFlush stdout after HTTP headers Err z3bra.org 70 i Err z3bra.org 70 iDiffstat: Err z3bra.org 70 i M phroxy.c | 2 ++ Err z3bra.org 70 i Err z3bra.org 70 i1 file changed, 2 insertions(+), 0 deletions(-) Err z3bra.org 70 i--- Err z3bra.org 70 1diff --git a/phroxy.c b/phroxy.c /scm/phroxy/file/phroxy.c.gph z3bra.org 70 it@@ -303,6 +303,7 @@ serveitem(char item, char *path, char *data, size_t len) Err z3bra.org 70 i case '1': // menu Err z3bra.org 70 i case '0': // text Err z3bra.org 70 i printf("\r\n"); Err z3bra.org 70 i+ fflush(stdout); Err z3bra.org 70 i write(1, head, strlen(head)); Err z3bra.org 70 i if (item == '1') printmenu(1, data); Err z3bra.org 70 i if (item == '0') printhtml(1, data, len); Err z3bra.org 70 it@@ -318,6 +319,7 @@ serveitem(char item, char *path, char *data, size_t len) Err z3bra.org 70 i case 'h': // http redirect Err z3bra.org 70 i printf("Content-Length: %ld\r\n", len); Err z3bra.org 70 i printf("\r\n"); Err z3bra.org 70 i+ fflush(stdout); Err z3bra.org 70 i send = data; Err z3bra.org 70 i while (len > 0) { Err z3bra.org 70 i if ((sent = write(1, send, len)) < 0) Err z3bra.org 70 .