#
# 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:
#
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)
-/* $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 */
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;
}
}
+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
*/
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;
{
-/* $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
int fd;
FtpData *data;
{
- if (fd > -1)
+ if (fd >= 0)
comm_close(fd);
xfree(data);
}
-/* $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
#include "squid.h"
-extern char *dns_error_message;
-
/* gopher type code from rfc. Anawat. */
#define GOPHER_FILE '0'
#define GOPHER_DIRECTORY '1'
int fd;
GopherData *data;
{
- if (fd > 0)
+ if (fd >+ 0)
comm_close(fd);
put_free_4k_page(data->buf, __FILE__, __LINE__);
xfree(data);
-/* $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
#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];
int fd;
HttpData *data;
{
- if (fd > 0)
+ if (fd >= 0)
comm_close(fd);
if (data) {
if (data->reply_hdr) {
-/* $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"
#include "ftp.h"
#include "gopher.h"
#include "wais.h"
+#include "connect.h"
#include "objcache.h"
#include "util.h"
-/* $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
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);
}