---------------------
PatchSet 1855 
Date: 2005/09/21 14:38:14
Author: audrus
Branch: squid3-icap
Tag: (none) 
Log:
*** empty log message ***

Members: 
	src/ICAPOptXact.cc:1.1.2.1->1.1.2.2 
	src/ICAPOptions.cc:1.1.2.2->1.1.2.3 
	src/ICAPOptions.h:1.1.2.2->1.1.2.3 
	src/ICAPServiceRep.cc:1.1.2.2->1.1.2.3 
	src/ICAPServiceRep.h:1.1.2.2->1.1.2.3 

Index: squid3/src/ICAPOptXact.cc
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPOptXact.cc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- squid3/src/ICAPOptXact.cc	20 Sep 2005 15:16:01 -0000	1.1.2.1
+++ squid3/src/ICAPOptXact.cc	21 Sep 2005 14:38:15 -0000	1.1.2.2
@@ -143,8 +143,8 @@
 void ICAPOptXact::startOptMod(ICAPServiceRep *anService)
 {
     debug(93,0)("ICAPOptXact::startOptMod() called\n");
-//    service = cbdataReference(anService);
-    service = anService;
+    service = cbdataReference(anService);
+//    service = anService;
 
     virgin = new MsgPipe("virgin");
     leakTouch(virgin.getRaw(), leaky);
@@ -381,8 +381,12 @@
 void ICAPOptXact::callEnd(const char *method)
 {
     if (done()) {
-        debugs(93, 5, "ICAPOptXact::" << method << " ends xaction " <<
-               status());
+        debugs(93, 5, "ICAPOptXact::" << method << " ends xaction " << status());
+        
+        service->icap_options = new ICAPOptions();
+        if (!service->icap_options->parseResponse()) {
+            debugs(93, 3, "ICAPOptXact::" << method << "error OPTIONS response parsing");
+        } 
         doStop();
         return;
     }
Index: squid3/src/ICAPOptions.cc
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPOptions.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- squid3/src/ICAPOptions.cc	12 Sep 2005 23:06:29 -0000	1.1.2.2
+++ squid3/src/ICAPOptions.cc	21 Sep 2005 14:38:15 -0000	1.1.2.3
@@ -267,3 +267,9 @@
         return false;
 };
 
+bool ICAPOptions::parseResponse(MemBuf *buf)
+{
+    responseBuf.append(buf->content(), buf->contentSize());
+    return parseResponse();   
+};
+
Index: squid3/src/ICAPOptions.h
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPOptions.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- squid3/src/ICAPOptions.h	12 Sep 2005 23:06:29 -0000	1.1.2.2
+++ squid3/src/ICAPOptions.h	21 Sep 2005 14:38:14 -0000	1.1.2.3
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ICAPOptions.h,v 1.1.2.2 2005/09/12 23:06:29 dwsquid Exp $
+ * $Id: ICAPOptions.h,v 1.1.2.3 2005/09/21 14:38:14 audrus Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -38,6 +38,8 @@
 #include "List.h"
 #include "ICAPServiceRep.h"
 
+class ICAPServiceRep;
+
 typedef enum{
     TRANSFER_NONE,
     TRANSFER_PREVIEW,
@@ -147,6 +149,7 @@
     int parseStep(int);
 
     bool parseResponse();
+    bool parseResponse(MemBuf *);
 
 };
 
Index: squid3/src/ICAPServiceRep.cc
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPServiceRep.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- squid3/src/ICAPServiceRep.cc	26 Aug 2005 20:28:41 -0000	1.1.2.2
+++ squid3/src/ICAPServiceRep.cc	21 Sep 2005 14:38:15 -0000	1.1.2.3
@@ -1,7 +1,7 @@
 #include "squid.h"
 #include "ICAPServiceRep.h"
 
-ICAPServiceRep::ICAPServiceRep(): port(-1)
+ICAPServiceRep::ICAPServiceRep(): port(-1), icap_options(NULL)
 {
     // XXX: these need to be config-driven, and initialized elsewhere
     method = xstrdup("RESPMOD");
Index: squid3/src/ICAPServiceRep.h
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPServiceRep.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- squid3/src/ICAPServiceRep.h	26 Aug 2005 20:28:41 -0000	1.1.2.2
+++ squid3/src/ICAPServiceRep.h	21 Sep 2005 14:38:15 -0000	1.1.2.3
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ICAPServiceRep.h,v 1.1.2.2 2005/08/26 20:28:41 dwsquid Exp $
+ * $Id: ICAPServiceRep.h,v 1.1.2.3 2005/09/21 14:38:15 audrus Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -35,11 +35,14 @@
 #define SQUID_ICAPSERVICEREP_H
 
 #include <string>
+#include "ICAPOptions.h"
 
 /* The ICAP service representative maintains information about a single
    ICAP service that Squid communicates with. One ICAP server may host 
    many ICAP services */
 
+class ICAPOptions;
+
 class ICAPServiceRep
 {
 
@@ -53,6 +56,9 @@
 
     char *host;
     int port;
+
+    ICAPOptions *icap_options;
+
 };
 
 #endif /* SQUID_ICAPSERVICEREP_H */
