From: wessels <> Date: Tue, 9 Apr 1996 00:28:53 +0000 (+0000) Subject: support for shttp and CONNECT urls; from moy@parc.xerox.com X-Git-Tag: SQUID_3_0_PRE1~6265 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=403279e0edc343f1ca5baaf37af0c21a434ffe44;p=thirdparty%2Fsquid.git support for shttp and CONNECT urls; from moy@parc.xerox.com --- diff --git a/src/Makefile.in b/src/Makefile.in index ee4dc84cb2..a27b3c6cac 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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) diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 4af0301f06..c462afd7fa 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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; { diff --git a/src/ftp.cc b/src/ftp.cc index e81d416c8e..732433f632 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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); } diff --git a/src/gopher.cc b/src/gopher.cc index c120ed567d..0e9072fd68 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -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); diff --git a/src/http.cc b/src/http.cc index a08208e861..012b5e3fd8 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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) { diff --git a/src/squid.h b/src/squid.h index 217710edef..5a7bca7234 100644 --- a/src/squid.h +++ b/src/squid.h @@ -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" diff --git a/src/wais.cc b/src/wais.cc index d2b1d57ec6..f917839a46 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -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); }