aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian2021-09-02 13:18:04 +0000
committerWolfgang Müller2021-09-08 15:40:46 +0200
commit664721b2882217fae1eb2ae506d65757a68cb007 (patch)
tree50a3c61dfe513382f6429c33fb7443b0da5b5f62
parentc503b09fe127a9d867cc4f522f4330ffa3314106 (diff)
downloadslowcgi-664721b2882217fae1eb2ae506d65757a68cb007.tar.gz
Stop sending debug logging to syslog (which would then drop it on the floor) all the time. Instead debug logging must be requested with the new -v flag. Problem reported and fix provided by weerd@
-rw-r--r--slowcgi.87
-rw-r--r--slowcgi.c19
2 files changed, 17 insertions, 9 deletions
diff --git a/slowcgi.8 b/slowcgi.8
index 3d162c9..810984d 100644
--- a/slowcgi.8
+++ b/slowcgi.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: slowcgi.8,v 1.14 2018/08/13 16:54:50 florian Exp $
+.\" $OpenBSD: slowcgi.8,v 1.15 2021/09/02 13:18:04 florian Exp $
.\"
.\" Copyright (c) 2013 Florian Obser <florian@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 13 2018 $
+.Dd $Mdocdate: September 2 2021 $
.Dt SLOWCGI 8
.Os
.Sh NAME
@@ -27,6 +27,7 @@
.Op Fl s Ar socket
.Op Fl U Ar user
.Op Fl u Ar user
+.Op Fl v
.Sh DESCRIPTION
.Nm
is a server which implements the FastCGI Protocol to execute CGI scripts.
@@ -90,6 +91,8 @@ instead of default user www and
to
the home directory of
.Ar user .
+.It Fl v
+Enable more verbose (debug) logging.
.El
.Sh SEE ALSO
.Xr httpd 8
diff --git a/slowcgi.c b/slowcgi.c
index e26d20a..5559d05 100644
--- a/slowcgi.c
+++ b/slowcgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slowcgi.c,v 1.60 2021/04/20 07:35:42 claudio Exp $ */
+/* $OpenBSD: slowcgi.c,v 1.61 2021/09/02 13:18:04 florian Exp $ */
/*
* Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
* Copyright (c) 2013 Florian Obser <florian@openbsd.org>
@@ -277,6 +277,7 @@ usage(void)
struct timeval timeout = { TIMEOUT_DEFAULT, 0 };
struct slowcgi_proc slowcgi_proc;
int debug = 0;
+int verbose = 0;
int on = 1;
char *fcgi_socket = "/var/www/run/slowcgi.sock";
@@ -309,7 +310,7 @@ main(int argc, char *argv[])
}
}
- while ((c = getopt(argc, argv, "dp:s:U:u:")) != -1) {
+ while ((c = getopt(argc, argv, "dp:s:U:u:v")) != -1) {
switch (c) {
case 'd':
debug++;
@@ -326,6 +327,9 @@ main(int argc, char *argv[])
case 'u':
slowcgi_user = optarg;
break;
+ case 'v':
+ verbose++;
+ break;
default:
usage();
/* NOTREACHED */
@@ -1282,9 +1286,10 @@ syslog_info(const char *fmt, ...)
void
syslog_debug(const char *fmt, ...)
{
- va_list ap;
-
- va_start(ap, fmt);
- vsyslog(LOG_DEBUG, fmt, ap);
- va_end(ap);
+ if (verbose > 0) {
+ va_list ap;
+ va_start(ap, fmt);
+ vsyslog(LOG_DEBUG, fmt, ap);
+ va_end(ap);
+ }
}