]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
adding passthrough module
authorwessels <>
Wed, 6 Nov 1996 03:43:50 +0000 (03:43 +0000)
committerwessels <>
Wed, 6 Nov 1996 03:43:50 +0000 (03:43 +0000)
src/Makefile.in
src/comm.cc
src/http.cc
src/squid.h

index ad3c1bb14ea3e8197b2778706b42d936174bd32a..a67cc473f00fe37b1967e3bdf27b64676bc03362 100644 (file)
@@ -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)\" \
index 2f7523a1199fd561cedf96622ec84f4db5205191..840b4fdcb613da25172ddff7a86a6018ad8b17bb 100644 (file)
@@ -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
index 67a951335ac48bd505291e8eb444f749a4d1e672..06de3b45df66f557ad2da91b077c9f9587d23249 100644 (file)
@@ -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);
 }
index 3ebaa5bfb5bef7ffc2fa68ce6b10faea0957c92f..b389c24aa4a53782d330df9f0977be512298509d 100644 (file)
@@ -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;