From eb7d6bd6cbfc077ca677fa41253a29a1f1f9c6fb Mon Sep 17 00:00:00 2001 From: hno <> Date: Mon, 15 Jul 2002 06:30:54 +0000 Subject: [PATCH] Cleanup of Gopher HTML code to use a common header format, and the standard Squid signature. --- src/gopher.cc | 59 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/src/gopher.cc b/src/gopher.cc index 55505bb64f..58a77b7c98 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -1,6 +1,6 @@ /* - * $Id: gopher.cc,v 1.164 2002/04/21 22:14:08 hno Exp $ + * $Id: gopher.cc,v 1.165 2002/07/15 00:30:54 hno Exp $ * * DEBUG: section 10 Gopher * AUTHOR: Harvest Derived @@ -237,13 +237,39 @@ gopherCachable(const request_t * req) return cachable; } +static void +gopherHTMLHeader(StoreEntry * e, const char *title, const char *substring) +{ + storeAppendPrintf(e, "
The Gopher query resulted in a blank response
"); + } else { + storeAppendPrintf(e, "\n"); + } + gopherHTMLFooter(e); } @@ -274,13 +300,12 @@ gopherToHTML(GopherStateData * gopherState, char *inbuf, int len) if (gopherState->conversion == HTML_INDEX_PAGE) { char *html_url = html_quote(storeUrl(entry)); + gopherHTMLHeader(entry, "Gopher Index %s", html_url); storeAppendPrintf(entry, - "This is a searchable Gopher index. Use the search\n"
"function of your browser to enter search terms.\n"
- "
A CSO database usually contains a phonebook or\n" "directory. Use the search function of your browser to enter\n" - "search terms.
\n"); + gopherHTMLHeader(entry, "CSO Search Result", NULL); else - strCat(outbuf, "Gopher Menu \n" - "Gopher Menu
\n\n"); + gopherHTMLHeader(entry, "Gopher Menu", NULL); + strCat(outbuf, ""); gopherState->HTML_header_added = 1; } while ((pos != NULL) && (pos < inbuf + len)) { @@ -746,7 +769,7 @@ gopherSendRequest(int fd, void *data) if (gopherState->type_id == GOPHER_CSO) { const char *t = strchr(gopherState->request, '?'); if (t != NULL) - t++; /* skip the ? */ + t++; /* skip the ? */ else t = ""; snprintf(buf, 4096, "query %s\r\nquit\r\n", t); -- 2.47.3