From: wessels <> Date: Wed, 6 Nov 1996 03:43:50 +0000 (+0000) Subject: adding passthrough module X-Git-Tag: SQUID_3_0_PRE1~5525 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5df6123045559256ff611e59eec3110c2bb1f5c2;p=thirdparty%2Fsquid.git adding passthrough module --- diff --git a/src/Makefile.in b/src/Makefile.in index ad3c1bb14e..a67cc473f0 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.52 1996/11/01 07:53:00 wessels Exp $ +# $Id: Makefile.in,v 1.53 1996/11/05 20:43:50 wessels Exp $ # # Uncomment and customize the following to suit your needs: # @@ -61,15 +61,50 @@ PROGS = squid client UTILS = dnsserver ftpget pinger CGIPROGS = cachemgr.cgi OBJS = \ - acl.o async_io.o background.o cache_cf.o client_db.o \ - client_side.o comm.o debug.o disk.o dns.o errorpage.o \ - fdstat.o filemap.o fqdncache.o ftp.o gopher.o hash.o \ - http.o icmp.o icp.o ident.o ipcache.o main.o mime.o \ - neighbors.o net_db.o objcache.o proto.o redirect.o \ + acl.o \ + async_io.o \ + background.o \ + cache_cf.o \ + client_db.o \ + client_side.o \ + comm.o \ + debug.o \ + disk.o \ + dns.o \ + errorpage.o \ + fdstat.o \ + filemap.o \ + fqdncache.o \ + ftp.o \ + gopher.o \ + hash.o \ + http.o \ + icmp.o \ + icp.o \ + ident.o \ + ipcache.o \ + main.o \ + mime.o \ + neighbors.o \ + net_db.o \ + objcache.o \ + pass.o \ + proto.o \ + redirect.o \ refresh.o \ - send-announce.o ssl.o stack.o stat.o stmem.o store.o \ - store_clean.o storetoString.o tools.o timestamps.o \ - url.o wais.o $(XTRA_OBJS) + send-announce.o \ + ssl.o \ + stack.o \ + stat.o \ + stmem.o \ + store.o \ + store_clean.o \ + storetoString.o \ + tools.o \ + timestamps.o \ + url.o \ + wais.o \ + $(XTRA_OBJS) DEFAULTS = \ -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ diff --git a/src/comm.cc b/src/comm.cc index 2f7523a119..840b4fdcb6 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.96 1996/11/04 18:12:19 wessels Exp $ + * $Id: comm.cc,v 1.97 1996/11/05 20:43:51 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -572,19 +572,23 @@ comm_udp_send(int fd, const char *host, u_short port, const char *buf, int len) /* Send a udp datagram to specified TO_ADDR. */ int -comm_udp_sendto(int fd, const struct sockaddr_in *to_addr, int addr_len, const char *buf, int len) +comm_udp_sendto(int fd, + const struct sockaddr_in *to_addr, + int addr_len, + const char *buf, + int len) { - int bytes_sent; - - if ((bytes_sent = sendto(fd, buf, len, 0, to_addr, addr_len)) < 0) { - debug(5, 1, "comm_udp_sendto: sendto failure: FD %d: %s\n", fd, xstrerror()); - debug(5, 1, "comm_udp_sendto: --> sin_family = %d\n", to_addr->sin_family); - debug(5, 1, "comm_udp_sendto: --> sin_port = %d\n", htons(to_addr->sin_port)); - debug(5, 1, "comm_udp_sendto: --> sin_addr = %s\n", inet_ntoa(to_addr->sin_addr)); - debug(5, 1, "comm_udp_sendto: --> length = %d\n", len); + int x; + x = sendto(fd, buf, len, 0, (struct sockaddr *) to_addr, addr_len); + if (x < 0) { + debug(5, 1, "comm_udp_sendto: FD %d, %s, port %d: %s\n", + fd, + inet_ntoa(to_addr->sin_addr), + (int) htons(to_addr->sin_port), + xstrerror()); return COMM_ERROR; } - return bytes_sent; + return x; } void diff --git a/src/http.cc b/src/http.cc index 67a951335a..06de3b45df 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,5 +1,5 @@ /* - * $Id: http.cc,v 1.95 1996/11/05 17:08:12 wessels Exp $ + * $Id: http.cc,v 1.96 1996/11/05 20:43:52 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -114,6 +114,11 @@ static struct { int exp; int clen; int ctype; + struct { + int private; + int cachable; + int nocache; + } cc; } ReplyHeaderStats; static void httpStateFree _PARAMS((int fd, void *)); @@ -259,12 +264,16 @@ httpParseHeaders(const char *buf, struct _http_reply *reply) } } else if (!strncasecmp(t, "Cache-Control:", 14)) { if ((t = strtok(NULL, w_space))) { - if (!strncasecmp(t, "private", 7)) + if (!strncasecmp(t, "private", 7)) { reply->cache_control |= HTTP_CC_PRIVATE; - else if (!strncasecmp(t, "cachable", 8)) + ReplyHeaderStats.cc.private++; + } else if (!strncasecmp(t, "cachable", 8)) { reply->cache_control |= HTTP_CC_CACHABLE; - else if (!strncasecmp(t, "no-cache", 8)) + ReplyHeaderStats.cc.cachable++; + } else if (!strncasecmp(t, "no-cache", 8)) { reply->cache_control |= HTTP_CC_NOCACHE; + ReplyHeaderStats.cc.nocache++; + } } } t = strtok(NULL, "\n"); @@ -810,5 +819,11 @@ httpReplyHeaderStats(StoreEntry * entry) ReplyHeaderStats.ctype); storeAppendPrintf(entry, "{Content-Length: %d}\n", ReplyHeaderStats.clen); + storeAppendPrintf(entry, "{Cache-Control Private: %d}\n", + ReplyHeaderStats.cc.private); + storeAppendPrintf(entry, "{Cache-Control Cachable: %d}\n", + ReplyHeaderStats.cc.cachable); + storeAppendPrintf(entry, "{Cache-Control Nocache: %d}\n", + ReplyHeaderStats.cc.nocache); storeAppendPrintf(entry, close_bracket); } diff --git a/src/squid.h b/src/squid.h index 3ebaa5bfb5..b389c24aa4 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.68 1996/11/05 17:08:23 wessels Exp $ + * $Id: squid.h,v 1.69 1996/11/05 20:43:56 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -313,6 +313,14 @@ extern const char *storeToString _PARAMS((const StoreEntry *)); extern void timestampsSet _PARAMS((StoreEntry *)); extern int waisStart _PARAMS((int, const char *, method_t, char *, StoreEntry *)); extern void storeDirClean _PARAMS((void)); +int +passStart _PARAMS((int fd, + const char *url, + request_t * request, + char *buf, + int buflen, + int *size_ptr)); + extern const char *const dash_str; extern const char *const null_string;