]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
support for shttp and CONNECT urls; from moy@parc.xerox.com
authorwessels <>
Tue, 9 Apr 1996 00:28:53 +0000 (00:28 +0000)
committerwessels <>
Tue, 9 Apr 1996 00:28:53 +0000 (00:28 +0000)
src/Makefile.in
src/cache_cf.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/squid.h
src/wais.cc

index ee4dc84cb2dbb6f0355427e0147ff421418531c8..a27b3c6cac4d95d1e271dbcec199e0e775c55cac 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Harvest Object Cache server
 #
-#  $Id: Makefile.in,v 1.10 1996/03/28 05:28:02 wessels Exp $
+#  $Id: Makefile.in,v 1.11 1996/04/08 18:28:53 wessels Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -57,17 +57,19 @@ CLIENT_LIBS = -L../lib -lutil $(XTRA_LIBS)
 PROGS          = cached 
 UTILS          = client dnsserver ftpget
 CGIPROGS       = cachemgr.cgi
-OBJS           = blocklist.o cached_error.o \
-                 comm.o cache_cf.o debug.o disk.o dynamic_array.o \
-                 fdstat.o filemap.o ftp.o gopher.o hash.o \
-                 http.o icp.o ipcache.o mime.o neighbors.o objcache.o \
-                 proto.o stack.o stat.o stmem.o store.o storetoString.o \
-                 tools.o ttl.o url.o wais.o $(XTRA_OBJS)
+OBJS           = blocklist.o cache_cf.o cached_error.o comm.o \
+               connect.o debug.o disk.o dynamic_array.o \
+               fdstat.o filemap.o ftp.o gopher.o \
+               hash.o http.o icp.o ipcache.o \
+               main.o mime.o neighbors.o objcache.o \
+               proto.o stack.o stat.o stmem.o \
+               store.o storetoString.o tools.o ttl.o \
+               url.o wais.o $(XTRA_OBJS)
 
 all:   $(PROGS) $(UTILS) $(CGIPROGS)
 
-cached:        main.o $(OBJS)
-       $(CC) -o $@ $(LDFLAGS) $(OBJS) main.o $(CRYPT_LIB) $(LIBS)
+cached:        $(OBJS)
+       $(CC) -o $@ $(LDFLAGS) $(OBJS) $(CRYPT_LIB) $(LIBS)
 
 client:        client.o
        $(CC) -o $@ $(LDFLAGS) $@.o $(CLIENT_LIBS)
index 4af0301f063131f9b44cf13270069cb708ebe17d..c462afd7fa9d5895caa5796123285c131742f296 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: cache_cf.cc,v 1.22 1996/04/08 17:07:59 wessels Exp $ */
+/* $Id: cache_cf.cc,v 1.23 1996/04/08 18:28:54 wessels Exp $ */
 
 /* DEBUG: Section 3             cache_cf: Configuration file parsing */
 
@@ -137,6 +137,19 @@ stoplist *bind_addr_list = NULL;
 stoplist *local_domain_list = NULL;
 stoplist *inside_firewall_list = NULL;
 
+ /* default CONNECT ports */
+ intlist snews = {
+       563,
+       NULL,
+ };
+ intlist https = {
+       443,
+       &snews,
+ };
+ intlist *connect_port_list = &https;
+
+
 ip_acl *proxy_ip_acl = NULL;
 ip_acl *accel_ip_acl = NULL;
 ip_acl *manager_ip_acl = NULL;
@@ -407,6 +420,29 @@ void addToStopList(list, key)
     }
 }
 
+static void addToIntList(list, str)
+      intlist **list;
+      char *str;
+ {
+     intlist *p, *q;
+     if (!(*list)) {
+       /* empty list */
+       *list = (intlist *) xcalloc(1, sizeof(intlist));
+       (*list)->i = atoi(str);
+       (*list)->next = NULL;
+     } else {
+       p = *list;
+       while (p->next)
+           p = p->next;
+       q = (intlist *) xcalloc(1, sizeof(intlist));
+       q->i = atoi(str);
+       q->next = NULL;
+       p->next = q;
+     }
+ }
+
+
 /* Use this #define in all the parse*() functions.  Assumes 
  * ** char *token and char *line_in are defined
  */
@@ -1128,6 +1164,22 @@ static void parseFtpUserLine(line_in)
     Config.ftpUser = xstrdup(token);
 }
 
+ static void parseConnectPortsLine(line_in)
+      char *line_in;
+ {
+     char *token;
+     static char origPortList = 1;
+     if (origPortList) {
+       connect_port_list = NULL;
+       origPortList = 0;
+     }
+     while ((token = strtok(NULL, w_space))) {
+       addToIntList(&connect_port_list, token);
+     }
+ }
+
+
 int parseConfigFile(file_name)
      char *file_name;
 {
index e81d416c8e7abbdeb3aa9ebad421bc90131db49f..732433f63295fb90d54570fb408ca5a5650ce825 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ftp.cc,v 1.22 1996/04/05 17:47:42 wessels Exp $ */
+/* $Id: ftp.cc,v 1.23 1996/04/08 18:28:56 wessels Exp $ */
 
 /*
  * DEBUG: Section 9           ftp: FTP
@@ -37,7 +37,7 @@ static void ftpCloseAndFree(fd, data)
      int fd;
      FtpData *data;
 {
-    if (fd > -1)
+    if (fd >= 0)
        comm_close(fd);
     xfree(data);
 }
index c120ed567d9f235d52abaead02017569528ecc3e..0e9072fd68179b4beead74662d95a80a9740d915 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: gopher.cc,v 1.17 1996/04/05 17:47:42 wessels Exp $ */
+/* $Id: gopher.cc,v 1.18 1996/04/08 18:28:56 wessels Exp $ */
 
 /*
  * DEBUG: Section 10          gopher: GOPHER
@@ -6,8 +6,6 @@
 
 #include "squid.h"
 
-extern char *dns_error_message;
-
 /* gopher type code from rfc. Anawat. */
 #define GOPHER_FILE         '0'
 #define GOPHER_DIRECTORY    '1'
@@ -73,7 +71,7 @@ static void gopherCloseAndFree(fd, data)
      int fd;
      GopherData *data;
 {
-    if (fd > 0)
+    if (fd >+ 0)
        comm_close(fd);
     put_free_4k_page(data->buf, __FILE__, __LINE__);
     xfree(data);
index a08208e861bb75342edf814afccafc5b9dd17c29..012b5e3fd8eb5faa2902aa83b088a2952117cbe6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: http.cc,v 1.31 1996/04/05 17:47:43 wessels Exp $ */
+/* $Id: http.cc,v 1.32 1996/04/08 18:28:57 wessels Exp $ */
 
 /*
  * DEBUG: Section 11          http: HTTP
@@ -10,9 +10,6 @@
 #define HTTP_DELETE_GAP   (64*1024)
 #define READBUFSIZ     4096
 
-extern int errno;
-extern char *dns_error_message;
-
 typedef struct _httpdata {
     StoreEntry *entry;
     char host[SQUIDHOSTNAMELEN + 1];
@@ -46,7 +43,7 @@ static void httpCloseAndFree(fd, data)
      int fd;
      HttpData *data;
 {
-    if (fd > 0)
+    if (fd >= 0)
        comm_close(fd);
     if (data) {
        if (data->reply_hdr) {
index 217710edef0d65d93003e2bcb34919af9431e738..5a7bca7234a90d224822d2bdb1d26414439f2b86 100644 (file)
@@ -1,5 +1,5 @@
 
-/* $Id: squid.h,v 1.9 1996/04/08 17:08:03 wessels Exp $ */
+/* $Id: squid.h,v 1.10 1996/04/08 18:28:58 wessels Exp $ */
 
 #include "config.h"
 #include "autoconf.h"
@@ -114,6 +114,7 @@ typedef unsigned long u_num32;
 #include "ftp.h"
 #include "gopher.h"
 #include "wais.h"
+#include "connect.h"
 #include "objcache.h"
 #include "util.h"
 
index d2b1d57ec64ab6360e0c235ad28dab71832576a2..f917839a463f7172ab1d66927b5d99dbdaffa8ae 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: wais.cc,v 1.19 1996/04/05 17:47:50 wessels Exp $ */
+/* $Id: wais.cc,v 1.20 1996/04/08 18:28:59 wessels Exp $ */
 
 /*
  * DEBUG: Section 24          wais
@@ -18,13 +18,11 @@ typedef struct _waisdata {
     char request[MAX_URL];
 } WAISData;
 
-extern char *dns_error_message;
-
 static void waisCloseAndFree(fd, data)
      int fd;
      WAISData *data;
 {
-    if (fd > 0)
+    if (fd >= 0)
        comm_close(fd);
     xfree(data);
 }