summaryrefslogtreecommitdiff
path: root/xs_fcgi.h
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-12-27 23:14:43 +0100
committerdefault <nobody@localhost>2023-12-27 23:14:43 +0100
commitecdb5aced89876814712bb3b83d671b787d47f4c (patch)
tree73af471f6d37ea178d85a7a7b861c3a10e40ac9c /xs_fcgi.h
parent7c2e2902ccb2b86eca75ac8cf6c82ada1eb247eb (diff)
In xs_fcgi_response(), don't add the b_size to the total size if body is NULL.
Diffstat (limited to 'xs_fcgi.h')
-rw-r--r--xs_fcgi.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/xs_fcgi.h b/xs_fcgi.h
index a7b766f..65d00da 100644
--- a/xs_fcgi.h
+++ b/xs_fcgi.h
@@ -324,15 +324,16 @@ void xs_fcgi_response(FILE *f, int status, xs_dict *headers, xs_str *body, int b
int size = strlen(out);
/* add the body */
- if (body != NULL && b_size > 0)
+ if (body != NULL && b_size > 0) {
out = xs_append_m(out, body, b_size);
+ size += b_size;
+ }
/* now send all the STDOUT in packets */
hdr.version = FCGI_VERSION_1;
hdr.type = FCGI_STDOUT;
hdr.id = fcgi_id;
- size += b_size;
int offset = 0;
while (offset < size) {