]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
merge 1.0.11 changes
authorwessels <>
Sat, 31 Aug 1996 05:23:27 +0000 (05:23 +0000)
committerwessels <>
Sat, 31 Aug 1996 05:23:27 +0000 (05:23 +0000)
ChangeLog
configure
configure.in
lib/tempnam.c
src/cachemgr.cc
src/errorpage.cc
src/fqdncache.cc
src/gopher.cc
src/store.cc
src/tools.cc
src/url.cc

index 9a7edc83e54884b40bca28a1faabe2ca9dc63088..0bb9fdf46755f24800508253d5437a71cbabf196 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -164,6 +164,22 @@ Changes to squid-1.1.alpha2:
 
 ==============================================================================
 
+Changes to squid-1.0.11 (August 30, 1996):
+
+       - Fixed ENTRY_DISPATCHED bug.  Now set ENTRY_DISPATCHED
+         only in getFromCache().
+       - Added missing newlines to a number of debug messages.
+       - NULL-terminate long URL's in urlParse().
+       - Changed configure to remove libmalloc for FreeBSD
+       - Changed ftpget to assume a single space between date and 
+         filename in Unix sytle listings.
+       - Added urlCheck() to check for supported method/protocol
+         combinations and return "501 Not Implemented" when
+         appropriate.
+       - Added ftpget check for negative port numbers in PASV
+         reply.
+       - Added shadow password support for cachemgr shutdown.
+
 Changes to squid-1.0.10 (August 26, 1996):
 
        - Fixed INADDR_NONE not being set for ftpget.c.
index b442acd92461b352a695bea12c80439e2ecd5087..ac441a437e3a78a4482581e55e296afa1a9e32fa 100755 (executable)
--- a/configure
+++ b/configure
@@ -517,7 +517,7 @@ fi
 
 
 
-# From configure.in Revision: 1.28 
+# From configure.in Revision: 1.29 
 ac_aux_dir=
 for ac_dir in aux $srcdir/aux; do
   if test -f $ac_dir/install-sh; then
@@ -2130,6 +2130,11 @@ case "$host" in
                        CFLAGS="`echo $CFLAGS | sed -e s/-O//`"
                fi
                ;;
+       i386-*-freebsd*)
+               echo "Removing -lmalloc for FreeBSD..."
+               LIBS=`echo $LIBS | sed -e s/-lmalloc//`
+               HAVE_LIBMALLOC="no"
+               ;;
        *-sgi-irix*)
                echo "Removing -lsocket for IRIX..."
                LIBS=`echo $LIBS | sed -e s/-lsocket//`
@@ -2185,7 +2190,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2189 "configure"
+#line 2194 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2235,7 +2240,7 @@ if test "$cross_compiling" = yes; then
   SQUID_FD_SETSIZE=256
 else
 cat > conftest.$ac_ext <<EOF
-#line 2239 "configure"
+#line 2244 "configure"
 #include "confdefs.h"
 
 #include <unistd.h>
@@ -2305,7 +2310,7 @@ if test "$cross_compiling" = yes; then
   SQUID_UDP_SO_SNDBUF=8192
 else
 cat > conftest.$ac_ext <<EOF
-#line 2309 "configure"
+#line 2314 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -2341,7 +2346,7 @@ if test "$cross_compiling" = yes; then
   SQUID_UDP_SO_RCVBUF=8192
 else
 cat > conftest.$ac_ext <<EOF
-#line 2345 "configure"
+#line 2350 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -2377,7 +2382,7 @@ if test "$cross_compiling" = yes; then
   SQUID_TCP_SO_SNDBUF=8192
 else
 cat > conftest.$ac_ext <<EOF
-#line 2381 "configure"
+#line 2386 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -2413,7 +2418,7 @@ if test "$cross_compiling" = yes; then
   SQUID_TCP_SO_RCVBUF=8192
 else
 cat > conftest.$ac_ext <<EOF
-#line 2417 "configure"
+#line 2422 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -2446,7 +2451,7 @@ EOF
 
 echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6
 cat > conftest.$ac_ext <<EOF
-#line 2450 "configure"
+#line 2455 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() { return 0; }
@@ -2470,7 +2475,7 @@ rm -f conftest*
 
 echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6
 cat > conftest.$ac_ext <<EOF
-#line 2474 "configure"
+#line 2479 "configure"
 #include "confdefs.h"
 extern int _dns_ttl_;
 int main() { return 0; }
index cf1809c31ff28f6bec388a9347cbfc84e14fab09..3d862732904b4b0eee8ce0d5391dad1f902c3ca3 100644 (file)
@@ -3,13 +3,13 @@ dnl  Configuration input file for Squid
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
 dnl
-dnl  $Id: configure.in,v 1.29 1996/08/27 20:10:47 wessels Exp $
+dnl  $Id: configure.in,v 1.30 1996/08/30 23:25:59 wessels Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.29 $)dnl
+AC_REVISION($Revision: 1.30 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(aux)
 
@@ -243,6 +243,11 @@ case "$host" in
                        CFLAGS="`echo $CFLAGS | sed -e s/-O//`"
                fi
                ;;
+       i386-*-freebsd*)
+               echo "Removing -lmalloc for FreeBSD..."
+               LIBS=`echo $LIBS | sed -e s/-lmalloc//`
+               HAVE_LIBMALLOC="no"
+               ;;
        *-sgi-irix*)
                echo "Removing -lsocket for IRIX..."
                LIBS=`echo $LIBS | sed -e s/-lsocket//`
index ba5f7ca80526cfd286603b45115cac0b4dea1de7..ce015017d04ea6208db516a1380fb9945fd6e5a4 100644 (file)
 #ifndef _POSIX_SOURCE
 #define _POSIX_SOURCE
 #endif /* _POSIX_SOURCE_ */
+#endif /* __NeXT__ */
+
 #if HAVE_STDIO_H
 #include <stdio.h>
 #endif
-#endif /* __NeXT__ */
-
 #if HAVE_ERRNO_H
 #include <errno.h>
 #endif
 #include <unistd.h>
 #endif
 
+#ifndef FILENAME_MAX
+#define FILENAME_MAX 1024
+#endif
+
 #define P_tmpdir      "/tmp"
 
 /* These are the characters used in temporary filenames.  */
index c2e908dbc423ce24488e82718be18eeeb44ef68b..368255dea146c47e202e838e82fc56f7f35706c8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cachemgr.cc,v 1.16 1996/08/26 19:57:02 wessels Exp $
+ * $Id: cachemgr.cc,v 1.17 1996/08/30 23:23:27 wessels Exp $
  *
  * DEBUG: Section 0     CGI Cache Manager
  * AUTHOR: Harvest Derived
@@ -283,30 +283,28 @@ void print_trailer()
     printf("<ADDRESS>\n");
     printf("Generated %s, by %s/%s@%s\n",
        tbuf, progname, SQUID_VERSION, getfullhostname());
-    printf("</ADDRESS>\n");
+    printf("</ADDRESS></BODY></HTML>\n");
 }
 
 void noargs_html()
 {
     printf("\r\n\r\n");
-    printf("<TITLE>Cache Manager Interface</TITLE>\n");
-    printf("<H1>Cache Manager Interface</H1>\n");
-    printf("<P>\n");
-    printf("This is a WWW interface to the instrumentation interface ");
-    printf("for the Squid object cache.\n");
+    printf("<HTML><HEAD><TITLE>Cache Manager Interface</TITLE></HEAD>\n");
+    printf("<BODY><H1>Cache Manager Interface</H1>\n");
+    printf("<p>This is a WWW interface to the instrumentation interface\n");
+    printf("for the Squid object cache.</p>\n");
     printf("<HR>\n");
-    printf("<P>\n");
-    printf("<FORM METHOD=\"POST\" ACTION=\"%s\">\n", script_name);
     printf("<PRE>\n");
-    printf("<BR><STRONG>Cache Host:</STRONG><INPUT NAME=\"host\" ");
-    printf("SIZE=30 VALUE=\"%s\">\n", CACHEMGR_HOSTNAME);
-    printf("<BR><STRONG>Cache Port:</STRONG><INPUT NAME=\"port\" ");
-    printf("SIZE=30 VALUE=\"%d\">\n", CACHE_HTTP_PORT);
-    printf("<BR><STRONG>Password  :</STRONG><INPUT TYPE=\"password\" ");
-    printf("NAME=\"password\" SIZE=30 VALUE=\"\">\n");
-    printf("<BR><STRONG>URL       :</STRONG><INPUT NAME=\"url\" ");
-    printf("SIZE=30 VALUE=\"\">\n");
-    printf("<BR><STRONG>Operation :</STRONG>");
+    printf("<FORM METHOD=\"POST\" ACTION=\"%s\">\n", script_name);
+    printf("<STRONG>Cache Host:</STRONG><INPUT NAME=\"host\" ");
+    printf("SIZE=30 VALUE=\"%s\">\n\n", CACHEMGR_HOSTNAME);
+    printf("<STRONG>Cache Port:</STRONG><INPUT NAME=\"port\" ");
+    printf("SIZE=30 VALUE=\"%d\">\n\n", CACHE_HTTP_PORT);
+    printf("<STRONG>Password  :</STRONG><INPUT TYPE=\"password\" ");
+    printf("NAME=\"password\" SIZE=30 VALUE=\"\">\n\n");
+    printf("<STRONG>URL       :</STRONG><INPUT NAME=\"url\" ");
+    printf("SIZE=30 VALUE=\"\">\n\n");
+    printf("<STRONG>Operation :</STRONG>");
     printf("<SELECT NAME=\"operation\">\n");
     printf("<OPTION SELECTED VALUE=\"info\">Cache Information\n");
     printf("<OPTION VALUE=\"squid.conf\">Cache Configuration File\n");
@@ -330,11 +328,10 @@ void noargs_html()
 #ifdef REMOVE_OBJECT
     printf("<OPTION VALUE=\"remove\">Remove Object (URL required)\n");
 #endif
-    printf("</SELECT>\n");
-    printf("</PRE>\n");
+    printf("</SELECT>\n\n");
     printf("<HR>\n");
-    printf("<BR><INPUT TYPE=\"submit\"> <INPUT TYPE=\"reset\">\n");
-    printf("</FORM>\n");
+    printf("<INPUT TYPE=\"submit\"> <INPUT TYPE=\"reset\">\n");
+    printf("</FORM></PRE>\n");
     print_trailer();
 }
 
@@ -568,7 +565,7 @@ int main(int argc, char *argv[])
        else if (!strncmp(entries[x].name, "port", 4))
            portnum = atoi(entries[x].val);
        else {
-           printf("<P><B>Unknown CGI parameter: %s</B></P>\n",
+           printf("<P><STRONG>Unknown CGI parameter: %s</STRONG></P>\n",
                entries[x].name);
            noargs_html();
            exit(0);
@@ -580,7 +577,7 @@ int main(int argc, char *argv[])
     }
     if (hostname[0] == '\0') {
        printf("<H1>ERROR</H1>\n");
-       printf("<P><B>You must provide a hostname!\n</B></P><HR>");
+       printf("<P><STRONG>You must provide a hostname!\n</STRONG></P><HR>");
        noargs_html();
        exit(0);
     }
@@ -688,8 +685,9 @@ int main(int argc, char *argv[])
     time_val = time(NULL);
     time_string = ctime(&time_val);
 
-    printf("<TITLE>Cache Manager: %s:%s:%d</TITLE>\n", operation, hostname, portnum);
-    printf("<FORM METHOD=\"POST\" ACTION=\"%s\">\n", script_name);
+    printf("<HTML><HEAD><TITLE>Cache Manager: %s:%s:%d</TITLE></HEAD>\n",
+       operation, hostname, portnum);
+    printf("<BODY><FORM METHOD=\"POST\" ACTION=\"%s\">\n", script_name);
     printf("<INPUT TYPE=\"submit\" VALUE=\"Refresh\">\n");
     printf("<SELECT NAME=\"operation\">\n");
     printf("<OPTION SELECTED VALUE=\"%s\">Current\n", operation);
@@ -715,11 +713,12 @@ int main(int argc, char *argv[])
     printf("<INPUT TYPE=\"hidden\" NAME=\"port\" VALUE=\"%d\">\n", portnum);
     printf("<INPUT TYPE=\"hidden\" NAME=\"password\" VALUE=\"NOT_PERMITTED\">\n");
     printf("</FORM>");
-    printf("<H3><I><A HREF=\"%s\">Empty form</A></H3></I>\n", script_name);
+    printf("<p><em><A HREF=\"%s\">Empty form</A></em></p>\n", script_name);
     printf("<HR>\n");
 
-    printf("<H3>%s:  %s:%d - dated %s</H3><P>", operation,
-       hostname, portnum, time_string);
+    printf("<H1>%s:  %s:%d</H1>\n", operation,
+       hostname, portnum);
+    printf("<p>dated %s</p>\n", time_string);
     printf("<PRE>\n");
 
     /* Connect to the server */
@@ -729,7 +728,7 @@ int main(int argc, char *argv[])
     }
     if ((conn = client_comm_connect(conn, hostname, portnum)) < 0) {
        printf("Error: connecting to cache mgr: %s:%d\n", hostname, portnum);
-       printf("%s</PRE>\n", xstrerror());
+       printf("%s</PRE></BODY></HTML>\n", xstrerror());
        exit(1);
     }
     bytesWritten = write(conn, msg, strlen(msg));
@@ -761,20 +760,21 @@ int main(int argc, char *argv[])
        break;
     case PARAM:
        if (hasTables) {
-           printf("<table border=1><td><B>Parameter</B><td><B>Value</B><td><B>Description</B><tr>\n");
+           printf("<table border=1><tr><td><STRONG>Parameter</STRONG><td><STRONG>Value</STRONG><td><STRONG>Description</STRONG>\n");
            in_table = 1;
        } else {
-           printf("<B>\n %20s %10s %s</B><HR>\n", "Parameter", "Value", "Description");
+           printf("\n    Parameter   Value   Description\n");
+           printf("-------------- ------- -------------------------------------\n");
        }
        break;
     case STATS_U:
        if (hasTables) {
-           printf("<table border=1><td><B>Protocol</B><td><B>Count</B><td><B>Max KB</B><td><B>Current KB</B><td><B>Min KB</B><td><B>Hit Ratio</B><td><B>Transfer Rate</B><td><B>References</B><td><B>Transfered KB</B><tr>\n");
+           printf("<table border=1><tr><td><STRONG>Protocol</STRONG><td><STRONG>Count</STRONG><td><STRONG>Max KB</STRONG><td><STRONG>Current KB</STRONG><td><STRONG>Min KB</STRONG><td><STRONG>Hit Ratio</STRONG><td><STRONG>Transfer Rate</STRONG><td><STRONG>References</STRONG><td><STRONG>Transfered KB</STRONG>\n");
            in_table = 1;
        } else {
-           printf("<B>Protocol | Count | Maximum  | Current  | Minimum | Hit   | Transfer | Reference | Transfered |</B>\n");
-           printf("<B>         |       | KB       | KB       | KB      | Ratio | Rate     | Count     | KB         |</B>\n");
-           printf("<B>---------|-------|----------|----------|---------|-------|----------|-----------|------------|</B>\n");
+           printf("Protocol  Count   Maximum   Current   Minimum  Hit  Trans   Transfer Transfered\n");
+           printf("                  KB        KB        KB       Rate KB/sec  Count     KB\n");
+           printf("-------- ------- --------- --------- --------- ---- ------ --------- ----------\n");
        }
        break;
     default:
@@ -838,19 +838,19 @@ int main(int argc, char *argv[])
                    d1 = 0;
                    sscanf(reserve, "%s %d \"%[^\"]", s1, &d1, s2);
                    if (hasTables)
-                       printf("<tr><td><B>%s</B><td>%d<td>%s\n", s1, d1, s2 + 2);
+                       printf("<tr><td><STRONG>%s</STRONG><td ALIGN=\"right\">%d<td>%s\n", s1, d1, s2 + 2);
                    else
-                       printf(" %20s %10d %s\n", s1, d1, s2 + 2);
+                       printf("%14s %7d %s\n", s1, d1, s2 + 2);
                    break;
                case STATS_U:
                    p_state = 1;
                    sscanf(reserve, "%s %d %d %d %d %f %d %d %d",
                        s1, &d1, &d2, &d3, &d4, &f1, &d5, &d6, &d7);
                    if (hasTables)
-                       printf("<tr><td align=right><B>%s</B><td align=right>%d<td align=right>%d<td align=right>%d<td align=right>%d<td align=right>%4.2f<td align=right>%d<td align=right>%d<td align=right>%d",
+                       printf("<tr><td align=\"right\"><B>%s</B><td align=\"right\">%d<td align=\"right\">%d<td align=\"right\">%d<td align=\"right\">%d<td align=\"right\">%4.2f<td align=\"right\">%d<td align=\"right\">%d<td align=\"right\">%d",
                            s1, d1, d2, d3, d4, f1, d5, d6, d7);
                    else
-                       printf("%8s %7d %10d %10d %9d    %4.2f %10d  %10d   %10d<BR>\n",
+                       printf("%8s %7d %9d %9d %9d %4.2f %6d %9d %10d\n",
                            s1, d1, d2, d3, d4, f1, d5, d6, d7);
                    break;
                case STATS_O:
index d23489f0839717a1f3ae496b21f6acc45111c9c3..8b719c47373ab56e1524a803dfea672de0f84873 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.34 1996/08/29 16:54:22 wessels Exp $
+ * $Id: errorpage.cc,v 1.35 1996/08/30 23:23:28 wessels Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
 #include "squid.h"
 
 #define SQUID_ERROR_MSG_P1 "\
+<HTML><HEAD>\n\
 <TITLE>ERROR: The requested URL could not be retrieved</TITLE>\n\
+</HEAD><BODY>\n\
+<H1>ERROR</H1>\n\
 <H2>The requested URL could not be retrieved</H2>\n\
 <HR>\n\
 <P>\n\
@@ -60,7 +63,7 @@ The following error was encountered:\n\
 <HR>\n\
 <ADDRESS>\n\
 Generated by %s/%s@%s\n\
-</ADDRESS>\n\
+</ADDRESS></BODY></HTML>\n\
 \n"
 
 typedef struct {
@@ -92,6 +95,9 @@ error_data ErrorData[] =
     {"ERR_INVALID_REQUEST",
        "Invalid HTTP request",
        "Please double check it, or ask for assistance."},
+    {"ERR_UNSUP_REQUEST",
+       "Unsupported request",
+       "This request method is not supported for this protocol."},
     {"ERR_INVALID_URL",
        "Invalid URL syntax",
        "Please double check it, or ask for assistance."},
@@ -115,7 +121,10 @@ error_data ErrorData[] =
        "The system disk is out of space or failing."},
     {"ERR_ZERO_SIZE_OBJECT",
        "No Object Data",
-       "The remote server closed the connection before sending any data."}
+       "The remote server closed the connection before sending any data."},
+    {"ERR_PROXY_DENIED",
+       "Access Denied",
+       "You must authenticate yourself before accessing this cache."}
 };
 
 /* GLOBAL */
@@ -210,7 +219,8 @@ char *squid_error_url(url, method, type, address, code, msg)
 
 
 #define SQUID_REQUEST_ERROR_MSG "\
-<TITLE>ERROR: Invalid HTTP Request</TITLE>\n\
+<HTML><HEAD><TITLE>ERROR: Invalid HTTP Request</TITLE></HEAD>\n\
+<BODY><H1>ERROR</H1>\n\
 <H2>Invalid HTTP Request</H2>\n\
 <HR>\n\
 <PRE>\n\
@@ -221,7 +231,7 @@ char *squid_error_url(url, method, type, address, code, msg)
 <HR>\n\
 <ADDRESS>\n\
 Generated by %s/%s@%s\n\
-</ADDRESS>\n\
+</ADDRESS></BODY></HTML>\n\
 \n"
 
 char *squid_error_request(request, type, address, code)
@@ -257,7 +267,8 @@ char *access_denied_msg(code, method, url, client)
 HTTP/1.0 %d Cache Access Denied\r\n\
 Content-type: text/html\r\n\
 \r\n\
-<TITLE>Cache Access Denied</TITLE>\n\
+<HTML><HEAD><TITLE>Cache Access Denied</TITLE></HEAD>\n\
+<BODY><H1>Error</H1>\n\
 <H2>Access Denied</H2>\n\
 <P>\n\
 Sorry, you are not currently allowed to request\n\
index 716f16a7a2d99b73d276409a6418ddb056be6781..16dc8462a2fa5bcca2b5ad6771bb0a97a374a503 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: fqdncache.cc,v 1.12 1996/08/30 22:38:15 wessels Exp $
+ * $Id: fqdncache.cc,v 1.13 1996/08/30 23:23:29 wessels Exp $
  *
  * DEBUG: section 35    FQDN Cache
  * AUTHOR: Harvest Derived
@@ -1042,9 +1042,8 @@ int fqdncacheQueueDrain()
     fqdncache_entry *i;
     dnsserver_t *dnsData;
     if (!fqdncacheQueueHead)
-        return 0;
+       return 0;
     while ((dnsData = dnsGetFirstAvailable()) && (i = fqdncacheDequeue()))
-        fqdncache_dnsDispatch(dnsData, i);
+       fqdncache_dnsDispatch(dnsData, i);
     return 1;
 }
-
index 1ceb783395a8667b32e4ba5296047c510e4516be..fef1b7acb1cc39e388a27c38f9194d555fac8123 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: gopher.cc,v 1.39 1996/08/26 19:16:05 wessels Exp $
+ * $Id: gopher.cc,v 1.40 1996/08/30 23:23:31 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -351,7 +351,8 @@ void gopherEndHTML(data)
     LOCAL_ARRAY(char, tmpbuf, TEMP_BUF_SIZE);
 
     if (!data->data_in) {
-       sprintf(tmpbuf, "<HR><H2><i>Server Return Nothing.</i></H2>\n");
+       sprintf(tmpbuf, "<HTML><HEAD><TITLE>Server Return Nothing.</TITLE>\n\
+       </HEAD><BODY><HR><H1>Server Return Nothing.</H1></BODY></HTML>\n");
        storeAppend(data->entry, tmpbuf, strlen(tmpbuf));
        return;
     }
@@ -387,8 +388,11 @@ void gopherToHTML(data, inbuf, len)
     entry = data->entry;
 
     if (data->conversion == HTML_INDEX_PAGE) {
-       sprintf(outbuf, "<TITLE>Gopher Index %s</TITLE><H1>%s<BR>Gopher Search</H1> This is a searchable Gopher index.Use the search function of your browser to enter search terms. <ISINDEX>\n", entry->url, entry->url);
-
+       sprintf(outbuf, "<HTML><HEAD><TITLE>Gopher Index %s</TITLE></HEAD>\n\
+               <BODY><H1>%s<BR>Gopher Search</H1>\n\
+               <p>This is a searchable Gopher index. Use the search\n\
+               function of your browser to enter search terms.\n\
+               <ISINDEX></BODY></HTML>\n", entry->url, entry->url);
        storeAppend(entry, outbuf, strlen(outbuf));
        /* now let start sending stuff to client */
        BIT_RESET(entry->flag, DELAY_SENDING);
@@ -397,7 +401,11 @@ void gopherToHTML(data, inbuf, len)
        return;
     }
     if (data->conversion == HTML_CSO_PAGE) {
-       sprintf(outbuf, "<TITLE>CSO Search of %s</TITLE><H1>%s<BR>CSO Search</H1>A CSO database usually contains a phonebook or directory. Use the search function of your browser to enter search terms.<ISINDEX>\n",
+       sprintf(outbuf, "<HTML><HEAD><TITLE>CSO Search of %s</TITLE></HEAD>\n\
+               <BODY><H1>%s<BR>CSO Search</H1>\n\
+               <P>A CSO database usually contains a phonebook or\n\
+               directory.  Use the search function of your browser to enter\n\
+               search terms.</P><ISINDEX></BODY></HTML>\n",
            entry->url, entry->url);
 
        storeAppend(entry, outbuf, strlen(outbuf));
@@ -411,9 +419,11 @@ void gopherToHTML(data, inbuf, len)
 
     if (!data->HTML_header_added) {
        if (data->conversion == HTML_CSO_RESULT)
-           strcat(outbuf, "<H1>CSO Searchs Result</H1>\n<PRE>\n");
+           strcat(outbuf, "<HTML><HEAD><TITLE>CSO Searchs Result</TITLE></HEAD>\n\
+               <BODY><H1>CSO Searchs Result</H1>\n<PRE>\n");
        else
-           strcat(outbuf, "<H1>Gopher Menu</H1>\n<PRE>\n");
+           strcat(outbuf, "<HTML><HEAD><TITLE>Gopher Menu</TITLE></HEAD>\n\
+               <BODY><H1>Gopher Menu</H1>\n<PRE>\n");
        data->HTML_header_added = 1;
     }
     while ((pos != NULL) && (pos < inbuf + len)) {
@@ -627,7 +637,7 @@ void gopherToHTML(data, inbuf, len)
                    case 502:   /* Too Many Matches */
                        {
                            /* Print the message the server returns */
-                           sprintf(tmpbuf, "</PRE><HR><H2><i>%s</i></H2>\n<PRE>", result);
+                           sprintf(tmpbuf, "</PRE><HR><H2>%s</H2>\n<PRE>", result);
                            strcat(outbuf, tmpbuf);
                            data->data_in = 1;
                            break;
index 76ae3cbeef852960cf527e876b2a8ad3a9a3cd57..77d80e62cfb6853e81baf772e8f4336691ab2771 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: store.cc,v 1.92 1996/08/30 22:44:13 wessels Exp $
+ * $Id: store.cc,v 1.93 1996/08/30 23:23:35 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -1746,7 +1746,7 @@ int storeAbort(e, msg)
        if ((int) (strlen(msg) + strlen(mime_hdr) + 50) < 2000) {
            sprintf(abort_msg, "HTTP/1.0 400 Cache Detected Error\r\n%s\r\n\r\n%s", mime_hdr, msg);
        } else {
-           debug(20, 0, "storeAbort: WARNING: Must increase msg length!");
+           debug(20, 0, "storeAbort: WARNING: Must increase msg length!\n");
        }
        storeAppend(e, abort_msg, strlen(abort_msg));
        safe_free(mem->e_abort_msg);
@@ -2755,7 +2755,7 @@ int storeWriteCleanLog()
     start = getCurrentTime();
     sprintf(tmp_filename, "%s/log_clean", swappath(0));
     if ((fp = fopen(tmp_filename, "a+")) == NULL) {
-       debug(20, 0, "storeWriteCleanLog: %s: %s", tmp_filename, xstrerror());
+       debug(20, 0, "storeWriteCleanLog: %s: %s\n", tmp_filename, xstrerror());
        return 0;
     }
     for (e = storeGetFirst(); e; e = storeGetNext()) {
@@ -2775,7 +2775,7 @@ int storeWriteCleanLog()
            e->object_len,
            e->url);
        if (x < 0) {
-           debug(20, 0, "storeWriteCleanLog: %s: %s", tmp_filename, xstrerror());
+           debug(20, 0, "storeWriteCleanLog: %s: %s\n", tmp_filename, xstrerror());
            debug(20, 0, "storeWriteCleanLog: Current swap logfile not replaced.\n");
            fclose(fp);
            safeunlink(tmp_filename, 0);
@@ -2787,7 +2787,7 @@ int storeWriteCleanLog()
        }
     }
     if (fclose(fp) < 0) {
-       debug(20, 0, "storeWriteCleanLog: %s: %s", tmp_filename, xstrerror());
+       debug(20, 0, "storeWriteCleanLog: %s: %s\n", tmp_filename, xstrerror());
        debug(20, 0, "storeWriteCleanLog: Current swap logfile not replaced.\n");
        safeunlink(tmp_filename, 0);
        return 0;
index accb2edde424a03cf5560b3cc9226e25ef27b932..e1165a9d168a96c6ce380f51edd0d716f41e76d5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.50 1996/08/30 22:44:15 wessels Exp $
+ * $Id: tools.cc,v 1.51 1996/08/30 23:23:36 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -485,7 +485,7 @@ void setMaxFD()
     struct rlimit rl;
 #if defined(RLIMIT_NOFILE)
     if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
-       debug(21, 0, "setrlimit: RLIMIT_NOFILE: %s", xstrerror());
+       debug(21, 0, "setrlimit: RLIMIT_NOFILE: %s\n", xstrerror());
     } else {
        rl.rlim_cur = FD_SETSIZE;
        if (rl.rlim_cur > rl.rlim_max)
@@ -497,7 +497,7 @@ void setMaxFD()
     }
 #elif defined(RLIMIT_OFILE)
     if (getrlimit(RLIMIT_OFILE, &rl) < 0) {
-       debug(21, 0, "setrlimit: RLIMIT_NOFILE: %s", xstrerror());
+       debug(21, 0, "setrlimit: RLIMIT_NOFILE: %s\n", xstrerror());
     } else {
        rl.rlim_cur = FD_SETSIZE;
        if (rl.rlim_cur > rl.rlim_max)
@@ -509,12 +509,12 @@ void setMaxFD()
     }
 #endif
 #else /* HAVE_SETRLIMIT */
-    debug(21, 1, "setMaxFD: Cannot increase: setrlimit() not supported on this system");
+    debug(21, 1, "setMaxFD: Cannot increase: setrlimit() not supported on this system\n");
 #endif /* HAVE_SETRLIMIT */
 
 #if HAVE_SETRLIMIT && defined(RLIMIT_DATA)
     if (getrlimit(RLIMIT_DATA, &rl) < 0) {
-       debug(21, 0, "getrlimit: RLIMIT_DATA: %s", xstrerror());
+       debug(21, 0, "getrlimit: RLIMIT_DATA: %s\n", xstrerror());
     } else {
        rl.rlim_cur = rl.rlim_max;      /* set it to the max */
        if (setrlimit(RLIMIT_DATA, &rl) < 0) {
index bb01d93af6716c85076c2265c86e66d0ca3b3630..1e532edd5e868bdf9e00321d166e76e148a3710b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: url.cc,v 1.30 1996/08/27 17:55:34 wessels Exp $
+ * $Id: url.cc,v 1.31 1996/08/30 23:23:36 wessels Exp $
  *
  * DEBUG: section 23    URL Parsing
  * AUTHOR: Duane Wessels
@@ -308,3 +308,24 @@ int matchDomainName(domain, host)
        return 1;
     return 0;
 }
+
+int urlCheckRequest(r)
+     request_t *r;
+{
+    int rc = 0;
+    switch (r->protocol) {
+    case PROTO_HTTP:
+    case PROTO_CACHEOBJ:
+       rc = 1;
+       break;
+    case PROTO_FTP:
+    case PROTO_GOPHER:
+    case PROTO_WAIS:
+       if (r->method == METHOD_GET)
+           rc = 1;
+       break;
+    default:
+       break;
+    }
+    return rc;
+}