Introduction
Introduction Statistics Contact Development Disclaimer Help
Add tcp connection logging - geomyidae - A small C-based gopherd.
git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfri…
Log
Files
Refs
Tags
README
LICENSE
---
commit baafaf38935f949caf81db281fc17bbeb9bbbe6c
parent aef0076447d9ca07b4e758287f611e6cbbda224e
Author: Quentin Rameau <[email protected]>
Date: Thu, 15 Jun 2017 19:21:31 +0200
Add tcp connection logging
Signed-off-by: Christoph Lohmann <[email protected]>
Diffstat:
M geomyidae.8 | 11 ++++++-----
M main.c | 6 +++++-
2 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/geomyidae.8 b/geomyidae.8
@@ -97,11 +97,12 @@ Set the logging level (default: 7)
.
.Bd -literal
Loglevels:
- 0 - no logging
- 1 - served plain files
- 2 - directory listings
- 4 - HTTP redirects
- 8 - errors (e.g., not found)
+ 0 - no logging
+ 1 - served plain files
+ 2 - directory listings
+ 4 - HTTP redirects
+ 8 - errors (e.g., not found)
+ 16 - client connections
e.g.:
1 + 2 + 4 + 8 = 15
(files + directories + HTTP + errors)
diff --git a/main.c b/main.c
@@ -32,7 +32,8 @@ enum {
FILES = 1,
DIRS = 2,
HTTP = 4,
- ERRORS = 8
+ ERRORS = 8,
+ CONN = 16
};
int glfd = -1;
@@ -476,6 +477,9 @@ main(int argc, char *argv[])
sizeof(clienth), clientp, sizeof(clientp),
NI_NUMERICHOST|NI_NUMERICSERV);
+ if (loglvl & CONN)
+ logentry(clienth, clientp, "-", "connected");
+
switch(fork()) {
case -1:
perror("fork");
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.