summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-12-27 23:14:43 +0100
committerGravatar default2023-12-27 23:14:43 +0100
commitecdb5aced89876814712bb3b83d671b787d47f4c (patch)
tree73af471f6d37ea178d85a7a7b861c3a10e40ac9c
parentThe actor link is now an anchored link to the people page for connected users. (diff)
downloadpenes-snac2-ecdb5aced89876814712bb3b83d671b787d47f4c.tar.gz
penes-snac2-ecdb5aced89876814712bb3b83d671b787d47f4c.tar.xz
penes-snac2-ecdb5aced89876814712bb3b83d671b787d47f4c.zip
In xs_fcgi_response(), don't add the b_size to the total size if body is NULL.
-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
324 int size = strlen(out); 324 int size = strlen(out);
325 325
326 /* add the body */ 326 /* add the body */
327 if (body != NULL && b_size > 0) 327 if (body != NULL && b_size > 0) {
328 out = xs_append_m(out, body, b_size); 328 out = xs_append_m(out, body, b_size);
329 size += b_size;
330 }
329 331
330 /* now send all the STDOUT in packets */ 332 /* now send all the STDOUT in packets */
331 hdr.version = FCGI_VERSION_1; 333 hdr.version = FCGI_VERSION_1;
332 hdr.type = FCGI_STDOUT; 334 hdr.type = FCGI_STDOUT;
333 hdr.id = fcgi_id; 335 hdr.id = fcgi_id;
334 336
335 size += b_size;
336 int offset = 0; 337 int offset = 0;
337 338
338 while (offset < size) { 339 while (offset < size) {