Adding nicer error messages. - geomyidae - A small C-based gopherd. HTML git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 63cd2d298843b1f144252f1902a7e1890000e1d7 DIR parent f2c2634b2cdd5ebb5dfc87dbc345f416a5fa7a41 HTML Author: Christoph Lohmann <20h@r-36.net> Date: Tue, 8 Mar 2011 14:08:08 +0100 Adding nicer error messages. Diffstat: M main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- DIR diff --git a/main.c b/main.c @@ -45,7 +45,7 @@ char *argv0; char *stdbase = "/var/gopher"; char *stdport = "70"; char *indexf = "/index.gph"; -char *err = "0Sorry, but the requested token could not be found\tErr" +char *err = "3Sorry, but the requested token '%s' could not be found.\tErr" "\tlocalhost\t70\r\n.\r\n\r\n"; char *htredir = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" @@ -192,7 +192,7 @@ handlerequest(int sock, char *base, char *ohost, char *port, char *clienth, return; } - send(sock, err, strlen(err), 0); + tprintf(sock, err, recvc); if(loglvl & ERRORS) logentry(clienth, clientp, recvc, "not found"); }