---------------------
PatchSet 4829 
Date: 2002/09/01 03:08:01
Author: rbcollins
Branch: rfc2616
Tag: (none) 
Log:
basic squid.conf choice of versions

Members: 
	configure.in:1.64->1.64.2.1 
	src/Makefile.am:1.23->1.23.6.1 
	src/cache_cf.c:1.46->1.46.6.1 
	src/cf.data.pre:1.78->1.78.2.1 
	src/http.c:1.21->1.21.6.1 
	src/structs.h:1.64->1.64.2.1 

Index: squid/configure.in
===================================================================
RCS file: /cvsroot/squid-sf//squid/configure.in,v
retrieving revision 1.64
retrieving revision 1.64.2.1
diff -u -r1.64 -r1.64.2.1
--- squid/configure.in	12 Aug 2002 22:38:17 -0000	1.64
+++ squid/configure.in	1 Sep 2002 03:08:01 -0000	1.64.2.1
@@ -3,15 +3,15 @@
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
 dnl
-dnl  $Id: configure.in,v 1.64 2002/08/12 22:38:17 squidadm Exp $
+dnl  $Id: configure.in,v 1.64.2.1 2002/09/01 03:08:01 rbcollins Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_AUX_DIR(cfgaux)
-AM_INIT_AUTOMAKE(squid, 2.6-DEVEL)
+AM_INIT_AUTOMAKE(squid, 2.6-DEVEL-RFC2616)
 AM_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.64 $)dnl
+AC_REVISION($Revision: 1.64.2.1 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AM_MAINTAINER_MODE
 
@@ -2139,7 +2139,7 @@
 else
 	AC_MSG_RESULT("no")
 	echo "Will use our own inet_ntoa()."
-	LIBOBJS="$LIBOBJS inet_ntoa.o"
+	AC_LIBOBJ([inet_ntoa])
 #	echo "WARNING: This looks bad, and probably prevents Squid from working."
 #	echo "         If you're on IRIX and using GCC 2.8, you probably need"
 #	echo "         to use the IRIX C compiler instead."
Index: squid/src/Makefile.am
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/Makefile.am,v
retrieving revision 1.23
retrieving revision 1.23.6.1
diff -u -r1.23 -r1.23.6.1
--- squid/src/Makefile.am	13 Jul 2002 22:08:09 -0000	1.23
+++ squid/src/Makefile.am	1 Sep 2002 03:08:02 -0000	1.23.6.1
@@ -148,6 +148,12 @@
 	HttpMsg.c \
 	HttpReply.c \
 	HttpRequest.c \
+	HttpStrategy.c \
+	HttpStrategy.h \
+	HttpStrategy_1_0.c \
+	HttpStrategy_1_0.h \
+	HttpStrategy_1_1.c \
+	HttpStrategy_1_1.h \
 	icmp.c \
 	icp_v2.c \
 	icp_v3.c \
Index: squid/src/cache_cf.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/cache_cf.c,v
retrieving revision 1.46
retrieving revision 1.46.6.1
diff -u -r1.46 -r1.46.6.1
--- squid/src/cache_cf.c	6 Jul 2002 19:50:20 -0000	1.46
+++ squid/src/cache_cf.c	1 Sep 2002 03:08:02 -0000	1.46.6.1
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.c,v 1.46 2002/07/06 19:50:20 squidadm Exp $
+ * $Id: cache_cf.c,v 1.46.6.1 2002/09/01 03:08:02 rbcollins Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -39,6 +39,9 @@
 #include "snmp.h"
 #endif
 
+#include "HttpStrategy_1_0.h"
+#include "HttpStrategy_1_1.h"
+
 static const char *const T_SECOND_STR = "second";
 static const char *const T_MINUTE_STR = "minute";
 static const char *const T_HOUR_STR = "hour";
@@ -352,6 +355,16 @@
     /* init memory as early as possible */
     memConfigure();
     /* Sanity checks */
+    /* Is the http version one we can satisfy? */
+    if (Config.HttpVersion == NULL)
+	fatal("No http_ersion configured.");
+    else if (!strcmp (Config.HttpVersion, "1.1")) {
+	httpStrategySetStrategy (HttpStrategy_1_1Create());
+    }
+    else if (!strcmp (Config.HttpVersion, "1.0")) {
+	httpStrategySetStrategy (HttpStrategy_1_0Create());
+    } else
+	fatal ("Unrecognized http_version - use 1.0 or 1.1");
     if (Config.cacheSwap.swapDirs == NULL)
 	fatal("No cache_dir's specified in config file");
     /* calculate Config.Swap.maxSize */
Index: squid/src/cf.data.pre
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/cf.data.pre,v
retrieving revision 1.78
retrieving revision 1.78.2.1
diff -u -r1.78 -r1.78.2.1
--- squid/src/cf.data.pre	28 Aug 2002 21:45:43 -0000	1.78
+++ squid/src/cf.data.pre	1 Sep 2002 03:08:02 -0000	1.78.2.1
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.78 2002/08/28 21:45:43 squidadm Exp $
+# $Id: cf.data.pre,v 1.78.2.1 2002/09/01 03:08:02 rbcollins Exp $
 #
 #
 # SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -48,6 +48,19 @@
 
 COMMENT_END
 
+NAME: http_version
+TYPE: string
+DEFAULT: 1.0
+LOC: Config.HttpVersion
+DOC_START
+	The HTTP version squid will operate at. Supported versions are 
+	1.0 and 1.1. The default if not set is 1.0.
+NOCOMMENT_START
+# Squid is a HTTP/1.1 conditionally compliant cache with this
+http_version 1.1
+NOCOMMENT_END
+DOC_END
+
 COMMENT_START
  NETWORK OPTIONS
  -----------------------------------------------------------------------------
Index: squid/src/http.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/http.c,v
retrieving revision 1.21
retrieving revision 1.21.6.1
diff -u -r1.21 -r1.21.6.1
--- squid/src/http.c	7 Jun 2002 22:43:02 -0000	1.21
+++ squid/src/http.c	1 Sep 2002 03:08:02 -0000	1.21.6.1
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.c,v 1.21 2002/06/07 22:43:02 squidadm Exp $
+ * $Id: http.c,v 1.21.6.1 2002/09/01 03:08:02 rbcollins Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -39,6 +39,7 @@
  */
 
 #include "squid.h"
+#include "HttpStrategy.h"
 
 static const char *const crlf = "\r\n";
 
@@ -900,9 +901,11 @@
     http_state_flags flags)
 {
     const int offset = mb->size;
-    memBufPrintf(mb, "%s %s HTTP/1.0\r\n",
+    http_version_t httpver = httpStrategyOurVersion(httpStrategyGetStrategy());
+    memBufPrintf(mb, "%s %s HTTP/%d.%d\r\n",
 	RequestMethodStr[request->method],
-	strLen(request->urlpath) ? strBuf(request->urlpath) : "/");
+	strLen(request->urlpath) ? strBuf(request->urlpath) : "/",
+	httpver.major,httpver.minor);
     /* build and pack headers */
     {
 	HttpHeader hdr;
Index: squid/src/structs.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/structs.h,v
retrieving revision 1.64
retrieving revision 1.64.2.1
diff -u -r1.64 -r1.64.2.1
--- squid/src/structs.h	28 Aug 2002 21:45:44 -0000	1.64
+++ squid/src/structs.h	1 Sep 2002 03:08:03 -0000	1.64.2.1
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.64 2002/08/28 21:45:44 squidadm Exp $
+ * $Id: structs.h,v 1.64.2.1 2002/09/01 03:08:03 rbcollins Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -689,6 +689,7 @@
     char *store_dir_select_algorithm;
     int sleep_after_fork;	/* microseconds */
     external_acl *externalAclHelperList;
+    char *HttpVersion;
 };
 
 struct _SquidConfig2 {
