commit 58022b948f64ce405f6aa71993ee1af6cf5187e6 from: Omar Polo date: Fri Sep 30 09:50:21 2022 UTC hide some debugging code behind a DPRINTF commit - 08d2220082cf5c8cc474a6621fe3bfa63c9aa277 commit + 58022b948f64ce405f6aa71993ee1af6cf5187e6 blob - d38f3dcbcaf3d10e3d4da1ad55b2a53a5d46a785 blob + 4d885b65be0ee5d2d4417410f60346802c9ee227 --- fcgi.c +++ fcgi.c @@ -320,7 +320,7 @@ fcgi_parse_params(struct fcgi *fcgi, struct evbuffer * free(clt->clt_server_name); if ((clt->clt_server_name = strdup(server)) == NULL) return (-1); - log_debug("clt %d: server_name: %s", clt->clt_id, + DPRINTF("clt %d: server_name: %s", clt->clt_id, clt->clt_server_name); continue; } @@ -342,7 +342,7 @@ fcgi_parse_params(struct fcgi *fcgi, struct evbuffer * if (clt->clt_script_name == NULL) return (-1); - log_debug("clt %d: script_name: %s", clt->clt_id, + DPRINTF("clt %d: script_name: %s", clt->clt_id, clt->clt_script_name); continue; } @@ -364,7 +364,7 @@ fcgi_parse_params(struct fcgi *fcgi, struct evbuffer * if (clt->clt_path_info == NULL) return (-1); - log_debug("clt %d: path_info: %s", clt->clt_id, + DPRINTF("clt %d: path_info: %s", clt->clt_id, clt->clt_path_info); continue; } @@ -380,7 +380,7 @@ fcgi_parse_params(struct fcgi *fcgi, struct evbuffer * if ((clt->clt_query = strdup(query)) == NULL) return (-1); - log_debug("clt %d: query: %s", clt->clt_id, + DPRINTF("clt %d: query: %s", clt->clt_id, clt->clt_query); continue; } @@ -493,13 +493,11 @@ fcgi_read(struct bufferevent *bev, void *d) fcgi->fcg_want = FCGI_RECORD_BODY; bufferevent_read(bev, &hdr, sizeof(hdr)); -#ifdef DEBUG - log_warnx("header: v=%d t=%d id=%d len=%d p=%d", + DPRINTF("header: v=%d t=%d id=%d len=%d p=%d", hdr.version, hdr.type, CAT(hdr.req_id0, hdr.req_id1), CAT(hdr.content_len0, hdr.content_len1), hdr.padding); -#endif if (hdr.version != FCGI_VERSION_1) { log_warnx("unknown fastcgi version: %d", blob - 780ecc4358beca7c292d1792d131340fec64f4aa blob + f1018797e482f4e51f445825c3a78d6136a57f46 --- galileo.h +++ galileo.h @@ -40,6 +40,12 @@ #define GEMINI_MAXLEN (1024 + 1) /* NULL */ #define FORM_URLENCODED "application/x-www-form-urlencoded" +#ifdef DEBUG +#define DPRINTF log_debug +#else +#define DPRINTF(x...) do {} while (0) +#endif + enum { METHOD_UNKNOWN, METHOD_GET,