diff options
| author | 2023-12-27 23:14:43 +0100 | |
|---|---|---|
| committer | 2023-12-27 23:14:43 +0100 | |
| commit | ecdb5aced89876814712bb3b83d671b787d47f4c (patch) | |
| tree | 73af471f6d37ea178d85a7a7b861c3a10e40ac9c /xs_fcgi.h | |
| parent | The actor link is now an anchored link to the people page for connected users. (diff) | |
| download | snac2-ecdb5aced89876814712bb3b83d671b787d47f4c.tar.gz snac2-ecdb5aced89876814712bb3b83d671b787d47f4c.tar.xz snac2-ecdb5aced89876814712bb3b83d671b787d47f4c.zip | |
In xs_fcgi_response(), don't add the b_size to the total size if body is NULL.
Diffstat (limited to '')
| -rw-r--r-- | xs_fcgi.h | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -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) { |