2 a596b957 2022-07-14 tracey * Copyright (c) 2020-2022 Tracey Emery <tracey@traceyemery.net>
3 a596b957 2022-07-14 tracey * Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
4 a596b957 2022-07-14 tracey * Copyright (c) 2013 Florian Obser <florian@openbsd.org>
6 a596b957 2022-07-14 tracey * Permission to use, copy, modify, and distribute this software for any
7 a596b957 2022-07-14 tracey * purpose with or without fee is hereby granted, provided that the above
8 a596b957 2022-07-14 tracey * copyright notice and this permission notice appear in all copies.
10 a596b957 2022-07-14 tracey * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 a596b957 2022-07-14 tracey * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 a596b957 2022-07-14 tracey * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 a596b957 2022-07-14 tracey * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 a596b957 2022-07-14 tracey * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 a596b957 2022-07-14 tracey * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 a596b957 2022-07-14 tracey * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 a596b957 2022-07-14 tracey #include <arpa/inet.h>
20 a596b957 2022-07-14 tracey #include <sys/queue.h>
21 a596b957 2022-07-14 tracey #include <sys/socket.h>
22 a596b957 2022-07-14 tracey #include <sys/types.h>
23 311b7e33 2022-08-01 op #include <sys/uio.h>
25 a596b957 2022-07-14 tracey #include <errno.h>
26 a596b957 2022-07-14 tracey #include <event.h>
27 a596b957 2022-07-14 tracey #include <imsg.h>
28 01498c42 2022-08-19 op #include <stdarg.h>
29 a596b957 2022-07-14 tracey #include <stdlib.h>
30 a596b957 2022-07-14 tracey #include <stdio.h>
31 a596b957 2022-07-14 tracey #include <string.h>
32 a596b957 2022-07-14 tracey #include <time.h>
33 a596b957 2022-07-14 tracey #include <unistd.h>
35 a596b957 2022-07-14 tracey #include "got_error.h"
37 a596b957 2022-07-14 tracey #include "proc.h"
38 a596b957 2022-07-14 tracey #include "gotwebd.h"
39 ed619ca0 2022-12-14 op #include "tmpl.h"
41 a596b957 2022-07-14 tracey size_t fcgi_parse_record(uint8_t *, size_t, struct request *);
42 a596b957 2022-07-14 tracey void fcgi_parse_begin_request(uint8_t *, uint16_t, struct request *,
43 a596b957 2022-07-14 tracey uint16_t);
44 a596b957 2022-07-14 tracey void fcgi_parse_params(uint8_t *, uint16_t, struct request *, uint16_t);
45 3ff00ead 2022-08-09 op int fcgi_send_response(struct request *, int, const void *, size_t);
47 a596b957 2022-07-14 tracey void dump_fcgi_record_header(const char *, struct fcgi_record_header *);
48 a596b957 2022-07-14 tracey void dump_fcgi_begin_request_body(const char *,
49 a596b957 2022-07-14 tracey struct fcgi_begin_request_body *);
50 a596b957 2022-07-14 tracey void dump_fcgi_end_request_body(const char *,
51 a596b957 2022-07-14 tracey struct fcgi_end_request_body *);
53 a596b957 2022-07-14 tracey extern int cgi_inflight;
54 a596b957 2022-07-14 tracey extern volatile int client_cnt;
57 a596b957 2022-07-14 tracey fcgi_request(int fd, short events, void *arg)
59 a596b957 2022-07-14 tracey struct request *c = arg;
60 a596b957 2022-07-14 tracey ssize_t n;
61 a596b957 2022-07-14 tracey size_t parsed = 0;
63 a596b957 2022-07-14 tracey n = read(fd, c->buf + c->buf_pos + c->buf_len,
64 a596b957 2022-07-14 tracey FCGI_RECORD_SIZE - c->buf_pos-c->buf_len);
66 a596b957 2022-07-14 tracey switch (n) {
68 a596b957 2022-07-14 tracey switch (errno) {
69 a596b957 2022-07-14 tracey case EINTR:
70 a596b957 2022-07-14 tracey case EAGAIN:
73 a596b957 2022-07-14 tracey goto fail;
78 a596b957 2022-07-14 tracey log_debug("closed connection");
79 a596b957 2022-07-14 tracey goto fail;
84 a596b957 2022-07-14 tracey c->buf_len += n;
87 a596b957 2022-07-14 tracey * Parse the records as they are received. Per the FastCGI
88 a596b957 2022-07-14 tracey * specification, the server need only receive the FastCGI
89 a596b957 2022-07-14 tracey * parameter records in full; it is free to begin execution
90 a596b957 2022-07-14 tracey * at that point, which is what happens here.
93 a596b957 2022-07-14 tracey parsed = fcgi_parse_record(c->buf + c->buf_pos, c->buf_len, c);
94 a596b957 2022-07-14 tracey if (parsed != 0) {
95 a596b957 2022-07-14 tracey c->buf_pos += parsed;
96 a596b957 2022-07-14 tracey c->buf_len -= parsed;
98 a596b957 2022-07-14 tracey } while (parsed > 0 && c->buf_len > 0);
100 a596b957 2022-07-14 tracey /* Make space for further reads */
101 a596b957 2022-07-14 tracey if (parsed != 0)
102 a596b957 2022-07-14 tracey if (c->buf_len > 0) {
103 a596b957 2022-07-14 tracey bcopy(c->buf + c->buf_pos, c->buf, c->buf_len);
104 a596b957 2022-07-14 tracey c->buf_pos = 0;
108 a596b957 2022-07-14 tracey fcgi_cleanup_request(c);
112 a596b957 2022-07-14 tracey fcgi_parse_record(uint8_t *buf, size_t n, struct request *c)
114 a596b957 2022-07-14 tracey struct fcgi_record_header *h;
116 a596b957 2022-07-14 tracey if (n < sizeof(struct fcgi_record_header))
117 a596b957 2022-07-14 tracey return 0;
119 a596b957 2022-07-14 tracey h = (struct fcgi_record_header*) buf;
121 a596b957 2022-07-14 tracey dump_fcgi_record("", h);
123 a596b957 2022-07-14 tracey if (n < sizeof(struct fcgi_record_header) + ntohs(h->content_len)
124 a596b957 2022-07-14 tracey + h->padding_len)
125 a596b957 2022-07-14 tracey return 0;
127 a596b957 2022-07-14 tracey if (h->version != 1)
128 a596b957 2022-07-14 tracey log_warn("wrong version");
130 a596b957 2022-07-14 tracey switch (h->type) {
131 a596b957 2022-07-14 tracey case FCGI_BEGIN_REQUEST:
132 a596b957 2022-07-14 tracey fcgi_parse_begin_request(buf +
133 a596b957 2022-07-14 tracey sizeof(struct fcgi_record_header),
134 a596b957 2022-07-14 tracey ntohs(h->content_len), c, ntohs(h->id));
136 a596b957 2022-07-14 tracey case FCGI_PARAMS:
137 a596b957 2022-07-14 tracey fcgi_parse_params(buf + sizeof(struct fcgi_record_header),
138 a596b957 2022-07-14 tracey ntohs(h->content_len), c, ntohs(h->id));
140 a596b957 2022-07-14 tracey case FCGI_STDIN:
141 a596b957 2022-07-14 tracey case FCGI_ABORT_REQUEST:
142 3ff00ead 2022-08-09 op if (c->sock->client_status != CLIENT_DISCONNECT &&
143 3ff00ead 2022-08-09 op c->outbuf_len != 0) {
144 3ff00ead 2022-08-09 op fcgi_send_response(c, FCGI_STDOUT, c->outbuf,
145 3ff00ead 2022-08-09 op c->outbuf_len);
148 a596b957 2022-07-14 tracey fcgi_create_end_record(c);
149 a596b957 2022-07-14 tracey fcgi_cleanup_request(c);
150 a596b957 2022-07-14 tracey return 0;
152 a596b957 2022-07-14 tracey log_warn("unimplemented type %d", h->type);
156 a596b957 2022-07-14 tracey return (sizeof(struct fcgi_record_header) + ntohs(h->content_len)
157 a596b957 2022-07-14 tracey + h->padding_len);
161 a596b957 2022-07-14 tracey fcgi_parse_begin_request(uint8_t *buf, uint16_t n,
162 a596b957 2022-07-14 tracey struct request *c, uint16_t id)
164 a596b957 2022-07-14 tracey /* XXX -- FCGI_CANT_MPX_CONN */
165 a596b957 2022-07-14 tracey if (c->request_started) {
166 a596b957 2022-07-14 tracey log_warn("unexpected FCGI_BEGIN_REQUEST, ignoring");
170 a596b957 2022-07-14 tracey if (n != sizeof(struct fcgi_begin_request_body)) {
171 a596b957 2022-07-14 tracey log_warn("wrong size %d != %lu", n,
172 a596b957 2022-07-14 tracey sizeof(struct fcgi_begin_request_body));
176 a596b957 2022-07-14 tracey c->request_started = 1;
177 a596b957 2022-07-14 tracey c->id = id;
181 a596b957 2022-07-14 tracey fcgi_parse_params(uint8_t *buf, uint16_t n, struct request *c, uint16_t id)
183 a596b957 2022-07-14 tracey uint32_t name_len, val_len;
184 40a95f4f 2022-09-01 op uint8_t *sd, *val;
186 a596b957 2022-07-14 tracey if (!c->request_started) {
187 a596b957 2022-07-14 tracey log_warn("FCGI_PARAMS without FCGI_BEGIN_REQUEST, ignoring");
191 a596b957 2022-07-14 tracey if (c->id != id) {
192 a596b957 2022-07-14 tracey log_warn("unexpected id, ignoring");
196 a596b957 2022-07-14 tracey if (n == 0) {
197 a596b957 2022-07-14 tracey gotweb_process_request(c);
201 a596b957 2022-07-14 tracey while (n > 0) {
202 a596b957 2022-07-14 tracey if (buf[0] >> 7 == 0) {
203 a596b957 2022-07-14 tracey name_len = buf[0];
207 a596b957 2022-07-14 tracey if (n > 3) {
208 a596b957 2022-07-14 tracey name_len = ((buf[0] & 0x7f) << 24) +
209 a596b957 2022-07-14 tracey (buf[1] << 16) + (buf[2] << 8) + buf[3];
211 a596b957 2022-07-14 tracey buf += 4;
219 40a95f4f 2022-09-01 op if (buf[0] >> 7 == 0) {
220 40a95f4f 2022-09-01 op val_len = buf[0];
225 40a95f4f 2022-09-01 op val_len = ((buf[0] & 0x7f) << 24) +
226 40a95f4f 2022-09-01 op (buf[1] << 16) + (buf[2] << 8) +
234 40a95f4f 2022-09-01 op if (n < name_len + val_len)
237 40a95f4f 2022-09-01 op val = buf + name_len;
239 40a95f4f 2022-09-01 op if (c->querystring[0] == '\0' &&
240 40a95f4f 2022-09-01 op val_len < MAX_QUERYSTRING &&
241 40a95f4f 2022-09-01 op name_len == 12 &&
242 40a95f4f 2022-09-01 op strncmp(buf, "QUERY_STRING", 12) == 0) {
243 40a95f4f 2022-09-01 op memcpy(c->querystring, val, val_len);
244 a596b957 2022-07-14 tracey c->querystring[val_len] = '\0';
247 40a95f4f 2022-09-01 op if (c->http_host[0] == '\0' &&
248 40a95f4f 2022-09-01 op val_len < GOTWEBD_MAXTEXT &&
249 40a95f4f 2022-09-01 op name_len == 9 &&
250 40a95f4f 2022-09-01 op strncmp(buf, "HTTP_HOST", 9) == 0) {
251 40a95f4f 2022-09-01 op memcpy(c->http_host, val, val_len);
252 40a95f4f 2022-09-01 op c->http_host[val_len] = '\0';
255 a596b957 2022-07-14 tracey * lazily get subdomain
256 a596b957 2022-07-14 tracey * will only get domain if no subdomain exists
257 a596b957 2022-07-14 tracey * this can still work if gotweb server name is the same
259 40a95f4f 2022-09-01 op sd = strchr(c->http_host, '.');
261 a596b957 2022-07-14 tracey *sd = '\0';
264 d19d9fce 2022-12-20 op if (c->document_uri[0] == '\0' &&
265 d19d9fce 2022-12-20 op val_len < MAX_DOCUMENT_URI &&
266 d19d9fce 2022-12-20 op name_len == 12 &&
267 d19d9fce 2022-12-20 op strncmp(buf, "DOCUMENT_URI", 12) == 0) {
268 d19d9fce 2022-12-20 op memcpy(c->document_uri, val, val_len);
269 d19d9fce 2022-12-20 op c->document_uri[val_len] = '\0';
272 40a95f4f 2022-09-01 op if (c->server_name[0] == '\0' &&
273 40a95f4f 2022-09-01 op val_len < MAX_SERVER_NAME &&
274 40a95f4f 2022-09-01 op name_len == 11 &&
275 40a95f4f 2022-09-01 op strncmp(buf, "SERVER_NAME", 11) == 0) {
276 40a95f4f 2022-09-01 op memcpy(c->server_name, val, val_len);
277 a596b957 2022-07-14 tracey c->server_name[val_len] = '\0';
280 1abb18e1 2022-12-20 op if (name_len == 5 &&
281 1abb18e1 2022-12-20 op strncmp(buf, "HTTPS", 5) == 0)
282 1abb18e1 2022-12-20 op c->https = 1;
284 40a95f4f 2022-09-01 op buf += name_len + val_len;
285 40a95f4f 2022-09-01 op n -= name_len - val_len;
290 a596b957 2022-07-14 tracey fcgi_timeout(int fd, short events, void *arg)
292 a596b957 2022-07-14 tracey fcgi_cleanup_request((struct request*) arg);
296 ed619ca0 2022-12-14 op fcgi_puts(struct template *tp, const char *str)
298 ed619ca0 2022-12-14 op if (str == NULL)
300 ed619ca0 2022-12-14 op return fcgi_gen_binary_response(tp->tp_arg, str, strlen(str));
304 ed619ca0 2022-12-14 op fcgi_putc(struct template *tp, int ch)
306 ed619ca0 2022-12-14 op uint8_t c = ch;
307 ed619ca0 2022-12-14 op return fcgi_gen_binary_response(tp->tp_arg, &c, 1);
311 8d02314f 2022-09-07 op fcgi_vprintf(struct request *c, const char *fmt, va_list ap)
316 01498c42 2022-08-19 op r = vasprintf(&str, fmt, ap);
317 01498c42 2022-08-19 op if (r == -1) {
318 01498c42 2022-08-19 op log_warn("%s: asprintf", __func__);
322 01498c42 2022-08-19 op r = fcgi_gen_binary_response(c, str, r);
328 8d02314f 2022-09-07 op fcgi_printf(struct request *c, const char *fmt, ...)
333 8d02314f 2022-09-07 op va_start(ap, fmt);
334 8d02314f 2022-09-07 op r = fcgi_vprintf(c, fmt, ap);
341 a596b957 2022-07-14 tracey fcgi_gen_binary_response(struct request *c, const uint8_t *data, int len)
345 a596b957 2022-07-14 tracey if (c->sock->client_status == CLIENT_DISCONNECT)
346 a596b957 2022-07-14 tracey return -1;
348 9dd0e5e9 2022-07-28 op if (data == NULL || len == 0)
349 a596b957 2022-07-14 tracey return 0;
352 3ff00ead 2022-08-09 op * special case: send big replies -like blobs- directly
353 3ff00ead 2022-08-09 op * without copying.
355 3ff00ead 2022-08-09 op if (len > sizeof(c->outbuf)) {
356 3ff00ead 2022-08-09 op if (c->outbuf_len > 0) {
357 3ff00ead 2022-08-09 op fcgi_send_response(c, FCGI_STDOUT,
358 3ff00ead 2022-08-09 op c->outbuf, c->outbuf_len);
359 3ff00ead 2022-08-09 op c->outbuf_len = 0;
361 3ff00ead 2022-08-09 op return fcgi_send_response(c, FCGI_STDOUT, data, len);
364 3ff00ead 2022-08-09 op if (len < sizeof(c->outbuf) - c->outbuf_len) {
365 3ff00ead 2022-08-09 op memcpy(c->outbuf + c->outbuf_len, data, len);
366 3ff00ead 2022-08-09 op c->outbuf_len += len;
370 3ff00ead 2022-08-09 op r = fcgi_send_response(c, FCGI_STDOUT, c->outbuf, c->outbuf_len);
374 3ff00ead 2022-08-09 op memcpy(c->outbuf, data, len);
375 3ff00ead 2022-08-09 op c->outbuf_len = len;
376 a596b957 2022-07-14 tracey return 0;
380 311b7e33 2022-08-01 op send_response(struct request *c, int type, const uint8_t *data,
383 311b7e33 2022-08-01 op static const uint8_t padding[FCGI_PADDING_SIZE];
384 311b7e33 2022-08-01 op struct fcgi_record_header header;
385 311b7e33 2022-08-01 op struct iovec iov[3];
386 a596b957 2022-07-14 tracey struct timespec ts;
388 311b7e33 2022-08-01 op size_t padded_len, tot;
389 311b7e33 2022-08-01 op int i, err = 0, th = 2000;
391 a596b957 2022-07-14 tracey ts.tv_sec = 0;
392 a596b957 2022-07-14 tracey ts.tv_nsec = 50;
394 311b7e33 2022-08-01 op memset(&header, 0, sizeof(header));
395 311b7e33 2022-08-01 op header.version = 1;
396 311b7e33 2022-08-01 op header.type = type;
397 311b7e33 2022-08-01 op header.id = htons(c->id);
398 311b7e33 2022-08-01 op header.content_len = htons(len);
400 a596b957 2022-07-14 tracey /* The FastCGI spec suggests to align the output buffer */
401 311b7e33 2022-08-01 op tot = sizeof(header) + len;
402 311b7e33 2022-08-01 op padded_len = FCGI_ALIGN(tot);
403 311b7e33 2022-08-01 op if (padded_len > tot) {
404 311b7e33 2022-08-01 op header.padding_len = padded_len - tot;
405 311b7e33 2022-08-01 op tot += header.padding_len;
408 311b7e33 2022-08-01 op iov[0].iov_base = &header;
409 311b7e33 2022-08-01 op iov[0].iov_len = sizeof(header);
411 311b7e33 2022-08-01 op iov[1].iov_base = (void *)data;
412 311b7e33 2022-08-01 op iov[1].iov_len = len;
414 311b7e33 2022-08-01 op iov[2].iov_base = (void *)padding;
415 311b7e33 2022-08-01 op iov[2].iov_len = header.padding_len;
417 311b7e33 2022-08-01 op dump_fcgi_record("resp ", &header);
420 a596b957 2022-07-14 tracey * XXX: add some simple write heuristics here
421 a596b957 2022-07-14 tracey * On slower VMs, spotty connections, etc., we don't want to go right to
422 a596b957 2022-07-14 tracey * disconnect. Let's at least try to write the data a few times before
423 a596b957 2022-07-14 tracey * giving up.
425 311b7e33 2022-08-01 op while (tot > 0) {
426 311b7e33 2022-08-01 op nw = writev(c->fd, iov, nitems(iov));
427 cb8b8986 2022-07-28 op if (nw == 0) {
428 cb8b8986 2022-07-28 op c->sock->client_status = CLIENT_DISCONNECT;
431 cb8b8986 2022-07-28 op if (nw == -1) {
433 cb8b8986 2022-07-28 op if (errno == EAGAIN && err < th) {
434 cb8b8986 2022-07-28 op nanosleep(&ts, NULL);
437 b43fa49a 2022-07-28 op log_warn("%s: write failure", __func__);
438 a596b957 2022-07-14 tracey c->sock->client_status = CLIENT_DISCONNECT;
442 311b7e33 2022-08-01 op if (nw != tot)
443 311b7e33 2022-08-01 op log_debug("%s: partial write: %zu vs %zu", __func__,
447 311b7e33 2022-08-01 op for (i = 0; i < nitems(iov); ++i) {
448 311b7e33 2022-08-01 op if (nw < iov[i].iov_len) {
449 311b7e33 2022-08-01 op iov[i].iov_base += nw;
450 311b7e33 2022-08-01 op iov[i].iov_len -= nw;
453 311b7e33 2022-08-01 op nw -= iov[i].iov_len;
454 311b7e33 2022-08-01 op iov[i].iov_len = 0;
462 311b7e33 2022-08-01 op fcgi_send_response(struct request *c, int type, const void *data,
465 3ff00ead 2022-08-09 op if (c->sock->client_status == CLIENT_DISCONNECT)
468 311b7e33 2022-08-01 op while (len > FCGI_CONTENT_SIZE) {
469 3ff00ead 2022-08-09 op if (send_response(c, type, data, len) == -1)
472 311b7e33 2022-08-01 op data += FCGI_CONTENT_SIZE;
473 311b7e33 2022-08-01 op len -= FCGI_CONTENT_SIZE;
476 311b7e33 2022-08-01 op if (len == 0)
479 3ff00ead 2022-08-09 op return send_response(c, type, data, len);
483 a596b957 2022-07-14 tracey fcgi_create_end_record(struct request *c)
485 311b7e33 2022-08-01 op struct fcgi_end_request_body end_request;
487 311b7e33 2022-08-01 op memset(&end_request, 0, sizeof(end_request));
488 311b7e33 2022-08-01 op end_request.app_status = htonl(0); /* script status */
489 311b7e33 2022-08-01 op end_request.protocol_status = FCGI_REQUEST_COMPLETE;
491 311b7e33 2022-08-01 op fcgi_send_response(c, FCGI_END_REQUEST, &end_request,
492 311b7e33 2022-08-01 op sizeof(end_request));
496 a596b957 2022-07-14 tracey fcgi_cleanup_request(struct request *c)
498 a596b957 2022-07-14 tracey cgi_inflight--;
499 a596b957 2022-07-14 tracey client_cnt--;
501 a596b957 2022-07-14 tracey evtimer_del(&c->tmo);
502 a596b957 2022-07-14 tracey if (event_initialized(&c->ev))
503 a596b957 2022-07-14 tracey event_del(&c->ev);
505 a596b957 2022-07-14 tracey close(c->fd);
506 ed619ca0 2022-12-14 op template_free(c->tp);
507 a596b957 2022-07-14 tracey gotweb_free_transport(c->t);
512 a596b957 2022-07-14 tracey dump_fcgi_record(const char *p, struct fcgi_record_header *h)
514 a596b957 2022-07-14 tracey dump_fcgi_record_header(p, h);
516 a596b957 2022-07-14 tracey if (h->type == FCGI_BEGIN_REQUEST)
517 a596b957 2022-07-14 tracey dump_fcgi_begin_request_body(p,
518 a596b957 2022-07-14 tracey (struct fcgi_begin_request_body *)(h + 1));
519 a596b957 2022-07-14 tracey else if (h->type == FCGI_END_REQUEST)
520 a596b957 2022-07-14 tracey dump_fcgi_end_request_body(p,
521 a596b957 2022-07-14 tracey (struct fcgi_end_request_body *)(h + 1));
525 a596b957 2022-07-14 tracey dump_fcgi_record_header(const char* p, struct fcgi_record_header *h)
527 a596b957 2022-07-14 tracey log_debug("%sversion: %d", p, h->version);
528 a596b957 2022-07-14 tracey log_debug("%stype: %d", p, h->type);
529 a596b957 2022-07-14 tracey log_debug("%srequestId: %d", p, ntohs(h->id));
530 a596b957 2022-07-14 tracey log_debug("%scontentLength: %d", p, ntohs(h->content_len));
531 a596b957 2022-07-14 tracey log_debug("%spaddingLength: %d", p, h->padding_len);
532 a596b957 2022-07-14 tracey log_debug("%sreserved: %d", p, h->reserved);
536 a596b957 2022-07-14 tracey dump_fcgi_begin_request_body(const char *p, struct fcgi_begin_request_body *b)
538 a596b957 2022-07-14 tracey log_debug("%srole %d", p, ntohs(b->role));
539 a596b957 2022-07-14 tracey log_debug("%sflags %d", p, b->flags);
543 a596b957 2022-07-14 tracey dump_fcgi_end_request_body(const char *p, struct fcgi_end_request_body *b)
545 a596b957 2022-07-14 tracey log_debug("%sappStatus: %d", p, ntohl(b->app_status));
546 a596b957 2022-07-14 tracey log_debug("%sprotocolStatus: %d", p, b->protocol_status);