diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2025-03-22 18:34:44 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska@appnovation.com> | 2025-03-22 18:34:44 +0000 |
| commit | a003745deaf4a84c173dd5625a4d22e6d4f6c405 (patch) | |
| tree | db780978b54ade4938c68fd5da3950ef21da7154 /src/tipideed/cgi.c | |
| parent | bfdd8182f9a098d400c83fd43c70cbb2ccc94264 (diff) | |
| download | tipidee-a003745deaf4a84c173dd5625a4d22e6d4f6c405.tar.gz | |
Make sure to flush before stream_fixed
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/tipideed/cgi.c')
| -rw-r--r-- | src/tipideed/cgi.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/tipideed/cgi.c b/src/tipideed/cgi.c index 7954ac9..1f55500 100644 --- a/src/tipideed/cgi.c +++ b/src/tipideed/cgi.c @@ -362,12 +362,9 @@ static inline int do_cgi (tipidee_rql *rql, char const *docroot, char const *con strerr_diefu1sys(111, "write to stdout") ; rbodylen -= len ; } - if (!rbodylen) - { - close(x[0].fd) ; - return 0 ; - } - stream_fixed(x[0].fd, rbodylen, argv[0]) ; + if (!buffer_timed_flush_g(buffer_1, &deadline)) + strerr_diefu1sys(111, "write to stdout") ; + if (rbodylen) stream_fixed(x[0].fd, rbodylen, argv[0]) ; } else if (autochunk) stream_autochunk(&b, argv[0]) ; |
