geomyidae

A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log | Files | Refs | README | LICENSE

commit 759d3017c73af279f7e0cec80f328e8da78d397d
parent 31cab7f26e390b9e29a3f9fa185df6bd67abd826
Author: Christoph Lohmann <20h@r-36.net>
Date:   Sat, 22 Jul 2023 20:02:18 +0200

Remove debugging from great refactoring.

Diffstat:
Mhandlr.c | 14--------------
Mmain.c | 17+----------------
2 files changed, 1 insertion(+), 30 deletions(-)

diff --git a/handlr.c b/handlr.c @@ -149,13 +149,6 @@ handlecgi(int sock, char *file, char *port, char *base, char *args, USED(base); USED(port); - printf("handlecgi:\n"); - printf("sock = %d; file = %s; port = %s; base = %s; args = %s;\n", - sock, file, port, base, args); - printf("sear = %s; ohost = %s; chost = %s; bhost = %s; istls = %d;\n", - sear, ohost, chost, bhost, istls); - printf("sel = %s; traverse = %s;\n", sel, traverse); - filec = xstrdup(file); scriptc = xstrdup(file); path = dirname(filec); @@ -207,13 +200,6 @@ handledcgi(int sock, char *file, char *port, char *base, char *args, int outsocks[2], ret = 0; gphelem *el; - printf("handledcgi:\n"); - printf("sock = %d; file = %s; port = %s; base = %s; args = %s;\n", - sock, file, port, base, args); - printf("sear = %s; ohost = %s; chost = %s; bhost = %s; istls = %d;\n", - sear, ohost, chost, bhost, istls); - printf("sel = %s; traverse = %s;\n", sel, traverse); - if (socketpair(AF_LOCAL, SOCK_STREAM, 0, outsocks) < 0) return; diff --git a/main.c b/main.c @@ -143,14 +143,6 @@ handlerequest(int sock, char *req, int rlen, char *base, char *ohost, int len = 0, fd, i, maxrecv, pathfallthrough = 0; filetype *type; - printf("handlerequest:\n"); - printf("sock = %d; req = '%s';\n", sock, req); - printf("rlen = %d; base = '%s'; ohost = '%s'; port = %s;\n", rlen, - base, ohost, port); - printf("clienth = %s; clientp = %s; serverh = %s; serverp = %s;\n", - clienth, clientp, serverh, serverp); - printf("nocgi = %d; istls = %d;\n", nocgi, istls); - if (!istls) { /* * If sticky bit is set on base dir and encryption is not @@ -263,8 +255,6 @@ dothegopher: *c++ = '\0'; snprintf(args, sizeof(args), "%s", c); } - printf("args = %s\n", args); - printf("recvb = %s\n", recvb); /* Strip '/' at the end of the request. */ for (c = recvb + strlen(recvb) - 1; c >= recvb && c[0] == '/'; c--) { @@ -273,9 +263,8 @@ dothegopher: snprintf(traverse, sizeof(traverse), "/%s", traversec); c[0] = '\0'; } - printf("traverse = %s\n", traverse); - printf("recvb = %s\n", recvb); + /* path is now always at least '/' */ if (snprintf(path, sizeof(path), "%s%s%s", base, (*recvb != '/')? "/" : "", recvb) > sizeof(path)) { @@ -286,8 +275,6 @@ dothegopher: dprintf(sock, toolongerr, recvc); return; } - /* path is now always at least '/' */ - printf("path = %s\n", path); fd = -1; /* @@ -330,7 +317,6 @@ dothegopher: ); /* path fallthrough */ pathfallthrough = 1; - printf("pathfallthrough = 1\n"); break; } /* Append found directory to path. */ @@ -343,7 +329,6 @@ dothegopher: if (loglvl & ERRORS) logentry(clienth, clientp, recvc, "not found"); } - printf("rpath = %s\n", rpath); if (stat(rpath, &dir) != -1) { /* * If sticky bit is set, only serve if this is encrypted.