commit ecdb5ac

default  ·  2023-12-27 22:14:43 +0000 UTC
parent 7c2e290
In xs_fcgi_response(), don't add the b_size to the total size if body is NULL.
1 files changed,  +3, -2
+3, -2
 1@@ -324,15 +324,16 @@ void xs_fcgi_response(FILE *f, int status, xs_dict *headers, xs_str *body, int b
 2     int size = strlen(out);
 3 
 4     /* add the body */
 5-    if (body != NULL && b_size > 0)
 6+    if (body != NULL && b_size > 0) {
 7         out = xs_append_m(out, body, b_size);
 8+        size += b_size;
 9+    }
10 
11     /* now send all the STDOUT in packets */
12     hdr.version = FCGI_VERSION_1;
13     hdr.type    = FCGI_STDOUT;
14     hdr.id      = fcgi_id;
15 
16-    size += b_size;
17     int offset = 0;
18 
19     while (offset < size) {