2 8a35f56c 2022-07-16 thomas * Copyright (c) 2020-2022 Tracey Emery <tracey@traceyemery.net>
3 8a35f56c 2022-07-16 thomas * Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
4 8a35f56c 2022-07-16 thomas * Copyright (c) 2013 Florian Obser <florian@openbsd.org>
6 8a35f56c 2022-07-16 thomas * Permission to use, copy, modify, and distribute this software for any
7 8a35f56c 2022-07-16 thomas * purpose with or without fee is hereby granted, provided that the above
8 8a35f56c 2022-07-16 thomas * copyright notice and this permission notice appear in all copies.
10 8a35f56c 2022-07-16 thomas * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 8a35f56c 2022-07-16 thomas * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 8a35f56c 2022-07-16 thomas * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 8a35f56c 2022-07-16 thomas * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 8a35f56c 2022-07-16 thomas * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 8a35f56c 2022-07-16 thomas * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 8a35f56c 2022-07-16 thomas * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 8a35f56c 2022-07-16 thomas #include <arpa/inet.h>
20 8b925c6c 2022-07-16 thomas #include <sys/queue.h>
21 8a35f56c 2022-07-16 thomas #include <sys/socket.h>
22 8a35f56c 2022-07-16 thomas #include <sys/types.h>
23 0335d24d 2022-08-06 thomas #include <sys/uio.h>
25 8a35f56c 2022-07-16 thomas #include <errno.h>
26 8a35f56c 2022-07-16 thomas #include <event.h>
27 8a35f56c 2022-07-16 thomas #include <stdlib.h>
28 8a35f56c 2022-07-16 thomas #include <stdio.h>
29 8a35f56c 2022-07-16 thomas #include <string.h>
30 8a35f56c 2022-07-16 thomas #include <time.h>
31 8a35f56c 2022-07-16 thomas #include <unistd.h>
33 8a35f56c 2022-07-16 thomas #include "got_error.h"
35 ff36aeea 2022-07-16 thomas #include "got_compat.h"
37 8a35f56c 2022-07-16 thomas #include "proc.h"
38 8a35f56c 2022-07-16 thomas #include "gotwebd.h"
40 8a35f56c 2022-07-16 thomas size_t fcgi_parse_record(uint8_t *, size_t, struct request *);
41 8a35f56c 2022-07-16 thomas void fcgi_parse_begin_request(uint8_t *, uint16_t, struct request *,
42 8a35f56c 2022-07-16 thomas uint16_t);
43 8a35f56c 2022-07-16 thomas void fcgi_parse_params(uint8_t *, uint16_t, struct request *, uint16_t);
44 0335d24d 2022-08-06 thomas void fcgi_send_response(struct request *, int, const void *, size_t);
46 8a35f56c 2022-07-16 thomas void dump_fcgi_record_header(const char *, struct fcgi_record_header *);
47 8a35f56c 2022-07-16 thomas void dump_fcgi_begin_request_body(const char *,
48 8a35f56c 2022-07-16 thomas struct fcgi_begin_request_body *);
49 8a35f56c 2022-07-16 thomas void dump_fcgi_end_request_body(const char *,
50 8a35f56c 2022-07-16 thomas struct fcgi_end_request_body *);
52 8a35f56c 2022-07-16 thomas extern int cgi_inflight;
53 8a35f56c 2022-07-16 thomas extern volatile int client_cnt;
56 8a35f56c 2022-07-16 thomas fcgi_request(int fd, short events, void *arg)
58 8a35f56c 2022-07-16 thomas struct request *c = arg;
59 8a35f56c 2022-07-16 thomas ssize_t n;
60 8a35f56c 2022-07-16 thomas size_t parsed = 0;
62 8a35f56c 2022-07-16 thomas n = read(fd, c->buf + c->buf_pos + c->buf_len,
63 8a35f56c 2022-07-16 thomas FCGI_RECORD_SIZE - c->buf_pos-c->buf_len);
65 8a35f56c 2022-07-16 thomas switch (n) {
67 8a35f56c 2022-07-16 thomas switch (errno) {
68 8a35f56c 2022-07-16 thomas case EINTR:
69 8a35f56c 2022-07-16 thomas case EAGAIN:
72 8a35f56c 2022-07-16 thomas goto fail;
77 8a35f56c 2022-07-16 thomas log_debug("closed connection");
78 8a35f56c 2022-07-16 thomas goto fail;
83 8a35f56c 2022-07-16 thomas c->buf_len += n;
86 8a35f56c 2022-07-16 thomas * Parse the records as they are received. Per the FastCGI
87 8a35f56c 2022-07-16 thomas * specification, the server need only receive the FastCGI
88 8a35f56c 2022-07-16 thomas * parameter records in full; it is free to begin execution
89 8a35f56c 2022-07-16 thomas * at that point, which is what happens here.
92 8a35f56c 2022-07-16 thomas parsed = fcgi_parse_record(c->buf + c->buf_pos, c->buf_len, c);
93 8a35f56c 2022-07-16 thomas if (parsed != 0) {
94 8a35f56c 2022-07-16 thomas c->buf_pos += parsed;
95 8a35f56c 2022-07-16 thomas c->buf_len -= parsed;
97 8a35f56c 2022-07-16 thomas } while (parsed > 0 && c->buf_len > 0);
99 8a35f56c 2022-07-16 thomas /* Make space for further reads */
100 8a35f56c 2022-07-16 thomas if (parsed != 0)
101 8a35f56c 2022-07-16 thomas if (c->buf_len > 0) {
102 8a35f56c 2022-07-16 thomas bcopy(c->buf + c->buf_pos, c->buf, c->buf_len);
103 8a35f56c 2022-07-16 thomas c->buf_pos = 0;
107 8a35f56c 2022-07-16 thomas fcgi_cleanup_request(c);
111 8a35f56c 2022-07-16 thomas fcgi_parse_record(uint8_t *buf, size_t n, struct request *c)
113 8a35f56c 2022-07-16 thomas struct fcgi_record_header *h;
115 8a35f56c 2022-07-16 thomas if (n < sizeof(struct fcgi_record_header))
116 8a35f56c 2022-07-16 thomas return 0;
118 8a35f56c 2022-07-16 thomas h = (struct fcgi_record_header*) buf;
120 8a35f56c 2022-07-16 thomas dump_fcgi_record("", h);
122 8a35f56c 2022-07-16 thomas if (n < sizeof(struct fcgi_record_header) + ntohs(h->content_len)
123 8a35f56c 2022-07-16 thomas + h->padding_len)
124 8a35f56c 2022-07-16 thomas return 0;
126 8a35f56c 2022-07-16 thomas if (h->version != 1)
127 8a35f56c 2022-07-16 thomas log_warn("wrong version");
129 8a35f56c 2022-07-16 thomas switch (h->type) {
130 8a35f56c 2022-07-16 thomas case FCGI_BEGIN_REQUEST:
131 8a35f56c 2022-07-16 thomas fcgi_parse_begin_request(buf +
132 8a35f56c 2022-07-16 thomas sizeof(struct fcgi_record_header),
133 8a35f56c 2022-07-16 thomas ntohs(h->content_len), c, ntohs(h->id));
135 8a35f56c 2022-07-16 thomas case FCGI_PARAMS:
136 8a35f56c 2022-07-16 thomas fcgi_parse_params(buf + sizeof(struct fcgi_record_header),
137 8a35f56c 2022-07-16 thomas ntohs(h->content_len), c, ntohs(h->id));
139 8a35f56c 2022-07-16 thomas case FCGI_STDIN:
140 8a35f56c 2022-07-16 thomas case FCGI_ABORT_REQUEST:
141 8a35f56c 2022-07-16 thomas fcgi_create_end_record(c);
142 8a35f56c 2022-07-16 thomas fcgi_cleanup_request(c);
143 8a35f56c 2022-07-16 thomas return 0;
145 8a35f56c 2022-07-16 thomas log_warn("unimplemented type %d", h->type);
149 8a35f56c 2022-07-16 thomas return (sizeof(struct fcgi_record_header) + ntohs(h->content_len)
150 8a35f56c 2022-07-16 thomas + h->padding_len);
154 8a35f56c 2022-07-16 thomas fcgi_parse_begin_request(uint8_t *buf, uint16_t n,
155 8a35f56c 2022-07-16 thomas struct request *c, uint16_t id)
157 8a35f56c 2022-07-16 thomas /* XXX -- FCGI_CANT_MPX_CONN */
158 8a35f56c 2022-07-16 thomas if (c->request_started) {
159 8a35f56c 2022-07-16 thomas log_warn("unexpected FCGI_BEGIN_REQUEST, ignoring");
163 8a35f56c 2022-07-16 thomas if (n != sizeof(struct fcgi_begin_request_body)) {
164 8a35f56c 2022-07-16 thomas log_warn("wrong size %d != %lu", n,
165 8a35f56c 2022-07-16 thomas sizeof(struct fcgi_begin_request_body));
169 8a35f56c 2022-07-16 thomas c->request_started = 1;
171 8a35f56c 2022-07-16 thomas c->id = id;
172 8a35f56c 2022-07-16 thomas SLIST_INIT(&c->env);
173 8a35f56c 2022-07-16 thomas c->env_count = 0;
177 8a35f56c 2022-07-16 thomas fcgi_parse_params(uint8_t *buf, uint16_t n, struct request *c, uint16_t id)
179 8a35f56c 2022-07-16 thomas struct env_val *env_entry;
180 8a35f56c 2022-07-16 thomas uint32_t name_len, val_len;
181 8a35f56c 2022-07-16 thomas uint8_t *sd, *dr_buf;
183 8a35f56c 2022-07-16 thomas if (!c->request_started) {
184 8a35f56c 2022-07-16 thomas log_warn("FCGI_PARAMS without FCGI_BEGIN_REQUEST, ignoring");
188 8a35f56c 2022-07-16 thomas if (c->id != id) {
189 8a35f56c 2022-07-16 thomas log_warn("unexpected id, ignoring");
193 8a35f56c 2022-07-16 thomas if (n == 0) {
194 8a35f56c 2022-07-16 thomas gotweb_process_request(c);
198 8a35f56c 2022-07-16 thomas while (n > 0) {
199 8a35f56c 2022-07-16 thomas if (buf[0] >> 7 == 0) {
200 8a35f56c 2022-07-16 thomas name_len = buf[0];
204 8a35f56c 2022-07-16 thomas if (n > 3) {
205 8a35f56c 2022-07-16 thomas name_len = ((buf[0] & 0x7f) << 24) +
206 8a35f56c 2022-07-16 thomas (buf[1] << 16) + (buf[2] << 8) + buf[3];
208 8a35f56c 2022-07-16 thomas buf += 4;
213 8a35f56c 2022-07-16 thomas if (n > 0) {
214 8a35f56c 2022-07-16 thomas if (buf[0] >> 7 == 0) {
215 8a35f56c 2022-07-16 thomas val_len = buf[0];
219 8a35f56c 2022-07-16 thomas if (n > 3) {
220 8a35f56c 2022-07-16 thomas val_len = ((buf[0] & 0x7f) << 24) +
221 8a35f56c 2022-07-16 thomas (buf[1] << 16) + (buf[2] << 8) +
224 8a35f56c 2022-07-16 thomas buf += 4;
231 8a35f56c 2022-07-16 thomas if (n < name_len + val_len)
234 8a35f56c 2022-07-16 thomas if ((env_entry = malloc(sizeof(struct env_val))) == NULL) {
235 8a35f56c 2022-07-16 thomas log_warn("cannot malloc env_entry");
239 8a35f56c 2022-07-16 thomas if ((env_entry->val = calloc(sizeof(char), name_len + val_len +
240 8a35f56c 2022-07-16 thomas 2)) == NULL) {
241 8a35f56c 2022-07-16 thomas log_warn("cannot allocate env_entry->val");
242 8a35f56c 2022-07-16 thomas free(env_entry);
246 8a35f56c 2022-07-16 thomas bcopy(buf, env_entry->val, name_len);
247 8a35f56c 2022-07-16 thomas buf += name_len;
248 8a35f56c 2022-07-16 thomas n -= name_len;
250 8a35f56c 2022-07-16 thomas env_entry->val[name_len] = '\0';
251 8a35f56c 2022-07-16 thomas if (val_len < MAX_QUERYSTRING && strcmp(env_entry->val,
252 8a35f56c 2022-07-16 thomas "QUERY_STRING") == 0 && c->querystring[0] == '\0') {
253 8a35f56c 2022-07-16 thomas bcopy(buf, c->querystring, val_len);
254 8a35f56c 2022-07-16 thomas c->querystring[val_len] = '\0';
256 8a35f56c 2022-07-16 thomas if (val_len < GOTWEBD_MAXTEXT && strcmp(env_entry->val,
257 8a35f56c 2022-07-16 thomas "HTTP_HOST") == 0 && c->http_host[0] == '\0') {
260 8a35f56c 2022-07-16 thomas * lazily get subdomain
261 8a35f56c 2022-07-16 thomas * will only get domain if no subdomain exists
262 8a35f56c 2022-07-16 thomas * this can still work if gotweb server name is the same
264 8a35f56c 2022-07-16 thomas sd = strchr(buf, '.');
266 8a35f56c 2022-07-16 thomas *sd = '\0';
268 8a35f56c 2022-07-16 thomas bcopy(buf, c->http_host, val_len);
269 8a35f56c 2022-07-16 thomas c->http_host[val_len] = '\0';
271 8a35f56c 2022-07-16 thomas if (val_len < MAX_DOCUMENT_ROOT && strcmp(env_entry->val,
272 8a35f56c 2022-07-16 thomas "DOCUMENT_ROOT") == 0 && c->document_root[0] == '\0') {
274 8a35f56c 2022-07-16 thomas /* drop first char, as it's always / */
275 8a35f56c 2022-07-16 thomas dr_buf = &buf[1];
277 8a35f56c 2022-07-16 thomas bcopy(dr_buf, c->document_root, val_len - 1);
278 8a35f56c 2022-07-16 thomas c->document_root[val_len] = '\0';
280 8a35f56c 2022-07-16 thomas if (val_len < MAX_SERVER_NAME && strcmp(env_entry->val,
281 8a35f56c 2022-07-16 thomas "SERVER_NAME") == 0 && c->server_name[0] == '\0') {
282 8a35f56c 2022-07-16 thomas /* drop first char, as it's always / */
284 8a35f56c 2022-07-16 thomas bcopy(buf, c->server_name, val_len);
285 8a35f56c 2022-07-16 thomas c->server_name[val_len] = '\0';
287 8a35f56c 2022-07-16 thomas env_entry->val[name_len] = '=';
289 8a35f56c 2022-07-16 thomas bcopy(buf, (env_entry->val) + name_len + 1, val_len);
290 8a35f56c 2022-07-16 thomas buf += val_len;
291 8a35f56c 2022-07-16 thomas n -= val_len;
293 8a35f56c 2022-07-16 thomas SLIST_INSERT_HEAD(&c->env, env_entry, entry);
294 8a35f56c 2022-07-16 thomas log_debug("env[%d], %s", c->env_count, env_entry->val);
295 8a35f56c 2022-07-16 thomas c->env_count++;
300 8a35f56c 2022-07-16 thomas fcgi_timeout(int fd, short events, void *arg)
302 8a35f56c 2022-07-16 thomas fcgi_cleanup_request((struct request*) arg);
306 8a35f56c 2022-07-16 thomas fcgi_gen_binary_response(struct request *c, const uint8_t *data, int len)
308 8a35f56c 2022-07-16 thomas if (c->sock->client_status == CLIENT_DISCONNECT)
309 8a35f56c 2022-07-16 thomas return -1;
311 0c2c6365 2022-07-28 thomas if (data == NULL || len == 0)
312 8a35f56c 2022-07-16 thomas return 0;
314 0335d24d 2022-08-06 thomas fcgi_send_response(c, FCGI_STDOUT, data, len);
315 8a35f56c 2022-07-16 thomas return 0;
319 8a35f56c 2022-07-16 thomas fcgi_gen_response(struct request *c, const char *data)
321 0c2c6365 2022-07-28 thomas if (data == NULL || *data == '\0')
322 8a35f56c 2022-07-16 thomas return 0;
323 0c2c6365 2022-07-28 thomas return fcgi_gen_binary_response(c, data, strlen(data));
326 0335d24d 2022-08-06 thomas static void
327 0335d24d 2022-08-06 thomas send_response(struct request *c, int type, const uint8_t *data,
328 0335d24d 2022-08-06 thomas size_t len)
330 0335d24d 2022-08-06 thomas static const uint8_t padding[FCGI_PADDING_SIZE];
331 0335d24d 2022-08-06 thomas struct fcgi_record_header header;
332 0335d24d 2022-08-06 thomas struct iovec iov[3];
333 8a35f56c 2022-07-16 thomas struct timespec ts;
334 a5a99557 2022-07-29 thomas ssize_t nw;
335 0335d24d 2022-08-06 thomas size_t padded_len, tot;
336 0335d24d 2022-08-06 thomas int i, err = 0, th = 2000;
338 8a35f56c 2022-07-16 thomas ts.tv_sec = 0;
339 8a35f56c 2022-07-16 thomas ts.tv_nsec = 50;
341 0335d24d 2022-08-06 thomas memset(&header, 0, sizeof(header));
342 0335d24d 2022-08-06 thomas header.version = 1;
343 0335d24d 2022-08-06 thomas header.type = type;
344 0335d24d 2022-08-06 thomas header.id = htons(c->id);
345 0335d24d 2022-08-06 thomas header.content_len = htons(len);
347 8a35f56c 2022-07-16 thomas /* The FastCGI spec suggests to align the output buffer */
348 0335d24d 2022-08-06 thomas tot = sizeof(header) + len;
349 0335d24d 2022-08-06 thomas padded_len = FCGI_ALIGN(tot);
350 0335d24d 2022-08-06 thomas if (padded_len > tot) {
351 0335d24d 2022-08-06 thomas header.padding_len = padded_len - tot;
352 0335d24d 2022-08-06 thomas tot += header.padding_len;
355 0335d24d 2022-08-06 thomas iov[0].iov_base = &header;
356 0335d24d 2022-08-06 thomas iov[0].iov_len = sizeof(header);
358 0335d24d 2022-08-06 thomas iov[1].iov_base = (void *)data;
359 0335d24d 2022-08-06 thomas iov[1].iov_len = len;
361 0335d24d 2022-08-06 thomas iov[2].iov_base = (void *)padding;
362 0335d24d 2022-08-06 thomas iov[2].iov_len = header.padding_len;
364 0335d24d 2022-08-06 thomas dump_fcgi_record("resp ", &header);
367 8a35f56c 2022-07-16 thomas * XXX: add some simple write heuristics here
368 8a35f56c 2022-07-16 thomas * On slower VMs, spotty connections, etc., we don't want to go right to
369 8a35f56c 2022-07-16 thomas * disconnect. Let's at least try to write the data a few times before
370 8a35f56c 2022-07-16 thomas * giving up.
372 0335d24d 2022-08-06 thomas while (tot > 0) {
373 0335d24d 2022-08-06 thomas nw = writev(c->fd, iov, nitems(iov));
374 a5a99557 2022-07-29 thomas if (nw == 0) {
375 a5a99557 2022-07-29 thomas c->sock->client_status = CLIENT_DISCONNECT;
378 a5a99557 2022-07-29 thomas if (nw == -1) {
380 a5a99557 2022-07-29 thomas if (errno == EAGAIN && err < th) {
381 a5a99557 2022-07-29 thomas nanosleep(&ts, NULL);
382 a5a99557 2022-07-29 thomas continue;
384 460244b7 2022-07-29 thomas log_warn("%s: write failure", __func__);
385 8a35f56c 2022-07-16 thomas c->sock->client_status = CLIENT_DISCONNECT;
389 0335d24d 2022-08-06 thomas if (nw != tot)
390 0335d24d 2022-08-06 thomas log_debug("%s: partial write: %zu vs %zu", __func__,
391 0335d24d 2022-08-06 thomas nw, tot);
393 0335d24d 2022-08-06 thomas tot -= nw;
394 0335d24d 2022-08-06 thomas for (i = 0; i < nitems(iov); ++i) {
395 0335d24d 2022-08-06 thomas if (nw < iov[i].iov_len) {
396 0335d24d 2022-08-06 thomas iov[i].iov_base += nw;
397 0335d24d 2022-08-06 thomas iov[i].iov_len -= nw;
400 0335d24d 2022-08-06 thomas nw -= iov[i].iov_len;
401 0335d24d 2022-08-06 thomas iov[i].iov_len = 0;
407 0335d24d 2022-08-06 thomas fcgi_send_response(struct request *c, int type, const void *data,
408 0335d24d 2022-08-06 thomas size_t len)
410 0335d24d 2022-08-06 thomas while (len > FCGI_CONTENT_SIZE) {
411 0335d24d 2022-08-06 thomas send_response(c, type, data, len);
412 0335d24d 2022-08-06 thomas if (c->sock->client_status == CLIENT_DISCONNECT)
415 0335d24d 2022-08-06 thomas data += FCGI_CONTENT_SIZE;
416 0335d24d 2022-08-06 thomas len -= FCGI_CONTENT_SIZE;
419 0335d24d 2022-08-06 thomas if (len == 0)
422 0335d24d 2022-08-06 thomas send_response(c, type, data, len);
426 8a35f56c 2022-07-16 thomas fcgi_create_end_record(struct request *c)
428 0335d24d 2022-08-06 thomas struct fcgi_end_request_body end_request;
430 0335d24d 2022-08-06 thomas memset(&end_request, 0, sizeof(end_request));
431 0335d24d 2022-08-06 thomas end_request.app_status = htonl(0); /* script status */
432 0335d24d 2022-08-06 thomas end_request.protocol_status = FCGI_REQUEST_COMPLETE;
434 0335d24d 2022-08-06 thomas fcgi_send_response(c, FCGI_END_REQUEST, &end_request,
435 0335d24d 2022-08-06 thomas sizeof(end_request));
439 8a35f56c 2022-07-16 thomas fcgi_cleanup_request(struct request *c)
441 8a35f56c 2022-07-16 thomas cgi_inflight--;
442 8a35f56c 2022-07-16 thomas client_cnt--;
444 8a35f56c 2022-07-16 thomas evtimer_del(&c->tmo);
445 8a35f56c 2022-07-16 thomas if (event_initialized(&c->ev))
446 8a35f56c 2022-07-16 thomas event_del(&c->ev);
448 8a35f56c 2022-07-16 thomas close(c->fd);
449 8a35f56c 2022-07-16 thomas gotweb_free_transport(c->t);
454 8a35f56c 2022-07-16 thomas dump_fcgi_record(const char *p, struct fcgi_record_header *h)
456 8a35f56c 2022-07-16 thomas dump_fcgi_record_header(p, h);
458 8a35f56c 2022-07-16 thomas if (h->type == FCGI_BEGIN_REQUEST)
459 8a35f56c 2022-07-16 thomas dump_fcgi_begin_request_body(p,
460 8a35f56c 2022-07-16 thomas (struct fcgi_begin_request_body *)(h + 1));
461 8a35f56c 2022-07-16 thomas else if (h->type == FCGI_END_REQUEST)
462 8a35f56c 2022-07-16 thomas dump_fcgi_end_request_body(p,
463 8a35f56c 2022-07-16 thomas (struct fcgi_end_request_body *)(h + 1));
467 8a35f56c 2022-07-16 thomas dump_fcgi_record_header(const char* p, struct fcgi_record_header *h)
469 8a35f56c 2022-07-16 thomas log_debug("%sversion: %d", p, h->version);
470 8a35f56c 2022-07-16 thomas log_debug("%stype: %d", p, h->type);
471 8a35f56c 2022-07-16 thomas log_debug("%srequestId: %d", p, ntohs(h->id));
472 8a35f56c 2022-07-16 thomas log_debug("%scontentLength: %d", p, ntohs(h->content_len));
473 8a35f56c 2022-07-16 thomas log_debug("%spaddingLength: %d", p, h->padding_len);
474 8a35f56c 2022-07-16 thomas log_debug("%sreserved: %d", p, h->reserved);
478 8a35f56c 2022-07-16 thomas dump_fcgi_begin_request_body(const char *p, struct fcgi_begin_request_body *b)
480 8a35f56c 2022-07-16 thomas log_debug("%srole %d", p, ntohs(b->role));
481 8a35f56c 2022-07-16 thomas log_debug("%sflags %d", p, b->flags);
485 8a35f56c 2022-07-16 thomas dump_fcgi_end_request_body(const char *p, struct fcgi_end_request_body *b)
487 8a35f56c 2022-07-16 thomas log_debug("%sappStatus: %d", p, ntohl(b->app_status));
488 8a35f56c 2022-07-16 thomas log_debug("%sprotocolStatus: %d", p, b->protocol_status);