summaryrefslogtreecommitdiffstats
path: root/usr.sbin/slowcgi
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2020-05-11 10:40:12 +0000
committerclaudio <claudio@openbsd.org>2020-05-11 10:40:12 +0000
commit47939e886b5cc9e7564dbde4494d6dd2ea1e4d9f (patch)
tree555076191515497c064d9ff3d902f29f3c02154c /usr.sbin/slowcgi
parentAdd support for VPNv6 in the family keyword of show rib (diff)
downloadwireguard-openbsd-47939e886b5cc9e7564dbde4494d6dd2ea1e4d9f.tar.xz
wireguard-openbsd-47939e886b5cc9e7564dbde4494d6dd2ea1e4d9f.zip
Allow specifying -d multiple times. Only print the fcgi header data if
debug > 1 (-dd) since it adds a lot of noise to the output. In syslog_debug do not check for the debug variable instead let syslog handle it. Currently syslog_debug() would never print anything since it is only called with debug = 0 (debug > 0 implies the console logger). OK florian@
Diffstat (limited to 'usr.sbin/slowcgi')
-rw-r--r--usr.sbin/slowcgi/slowcgi.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.sbin/slowcgi/slowcgi.c b/usr.sbin/slowcgi/slowcgi.c
index 6610012e080..4797c47bc80 100644
--- a/usr.sbin/slowcgi/slowcgi.c
+++ b/usr.sbin/slowcgi/slowcgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slowcgi.c,v 1.56 2020/05/08 07:41:33 claudio Exp $ */
+/* $OpenBSD: slowcgi.c,v 1.57 2020/05/11 10:40:12 claudio Exp $ */
/*
* Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
* Copyright (c) 2013 Florian Obser <florian@openbsd.org>
@@ -300,7 +300,7 @@ main(int argc, char *argv[])
while ((c = getopt(argc, argv, "dp:s:U:u:")) != -1) {
switch (c) {
case 'd':
- debug = 1;
+ debug++;
break;
case 'p':
chrootpath = optarg;
@@ -605,7 +605,7 @@ slowcgi_response(int fd, short events, void *arg)
while ((resp = TAILQ_FIRST(&c->response_head))) {
header = (struct fcgi_record_header*) resp->data;
- if (debug)
+ if (debug > 1)
dump_fcgi_record("resp ", header);
n = write(fd, resp->data + resp->data_pos, resp->data_len);
@@ -842,7 +842,7 @@ parse_record(uint8_t *buf, size_t n, struct request *c)
h = (struct fcgi_record_header*) buf;
- if (debug)
+ if (debug > 1)
dump_fcgi_record("", h);
if (n < sizeof(struct fcgi_record_header) + ntohs(h->content_len)
@@ -1293,9 +1293,6 @@ syslog_debug(const char *fmt, ...)
{
va_list ap;
- if (!debug)
- return;
-
va_start(ap, fmt);
vsyslog(LOG_DEBUG, fmt, ap);
va_end(ap);