]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix build errors in layer-02
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 10 Jan 2009 03:04:47 +0000 (16:04 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 10 Jan 2009 03:04:47 +0000 (16:04 +1300)
src/icmp/Makefile.am
src/ip/QosConfig.cc
src/ip/QosConfig.h
src/ip/stubQosConfig.cc

index aae47e9d04eee3235544bd964ed5e67498f89be2..dbdc3debd02318851ca1d3fe6d6e847fbb3d0e94 100644 (file)
@@ -65,12 +65,12 @@ nodist_pinger_SOURCES = \
        ../globals.cc \
        ../time.cc \
        ../SquidConfig.cc \
-       ../SquidNew.cc \
-       ../ip/stubQosConfig.cc
+       ../SquidNew.cc
 
 pinger_LDFLAGS = $(LIBADD_DL)
 pinger_LDADD=\
        libicmp-core.la \
+       ../ip/libip.la \
        $(top_builddir)/lib/libmiscutil.a
 pinger_DEPENDENCIES= \
        libicmp-core.la \
@@ -123,6 +123,7 @@ testIcmp_LDADD=\
        @SQUID_CPPUNIT_LIBS@ \
        @SQUID_CPPUNIT_LA@ \
        libicmp-core.la \
+       ../ip/libip.la \
        $(top_builddir)/lib/libmiscutil.a
 testIcmp_DEPENDENCIES= @SQUID_CPPUNIT_LA@ \
        libicmp-core.la \
index 3ce3687fd0584fd5ea83912f7f78a135473cbcd4..6a4d3530f91b759838eafa0d5487e03d2db18676 100644 (file)
@@ -3,7 +3,6 @@
 #if USE_ZPH_QOS
 
 #include "QosConfig.h"
-#include "Store.h"
 
 QosConfig::QosConfig() : 
        tos_local_hit(0),
@@ -42,28 +41,41 @@ QosConfig::parseConfigLine()
     }
 }
 
+/**
+ * NOTE: Due to the low-level nature of the library these
+ * objects are part of the dump function must be self-contained.
+ * which means no StoreEntry refrences. Just a basic char* buffer.
+ */
 void
-QosConfig::dumpConfigLine(StoreEntry * entry, const char *name) const
+QosConfig::dumpConfigLine(char *entry, const char *name) const
 {
-    storeAppendPrintf(entry, "%s", name);
+    char *p = entry;
+    snprintf(p, 10, "%s", name); // strlen("qos_flows ");
+    p += strlen(name);
 
     if (tos_local_hit >0) {
-        storeAppendPrintf(entry, " local-hit=%2x", tos_local_hit);
+        snprintf(p, 15, " local-hit=%2x", tos_local_hit);
+        p += 15;
     }
 
     if (tos_sibling_hit >0) {
-        storeAppendPrintf(entry, " sibling-hit=%2x", tos_sibling_hit);
+        snprintf(p, 17, " sibling-hit=%2x", tos_sibling_hit);
+        p += 17;
     }
     if (tos_parent_hit >0) {
-        storeAppendPrintf(entry, " parent-hit=%2x", tos_parent_hit);
+        snprintf(p, 16, " parent-hit=%2x", tos_parent_hit);
+        p += 16;
     }
     if (preserve_miss_tos != 0) {
-        storeAppendPrintf(entry, " disable-preserve-miss");
+        snprintf(p, 22, " disable-preserve-miss");
+        p += 22;
     }
     if (preserve_miss_tos && preserve_miss_tos_mask != 0) {
-        storeAppendPrintf(entry, " miss-mask=%2x", preserve_miss_tos_mask);
+        snprintf(p, 15, " miss-mask=%2x", preserve_miss_tos_mask);
+        p += 15;
     }
-    storeAppendPrintf(entry, "\n");
+    snprintf(p, 1, "\n");
+//    p += 1;
 }
 
 #endif /* USE_ZPH_QOS */
index 61d400a8d488237cdae14926f724ce65b72f692f..62294bf8c2e4e37ec29501564baf7e534dce5f7c 100644 (file)
@@ -5,8 +5,6 @@
 
 #if USE_ZPH_QOS
 
-class StoreEntry;
-
 class QosConfig
 {
 public:
@@ -21,13 +19,17 @@ public:
     ~QosConfig() {};
 
     void parseConfigLine();
-    void dumpConfigLine(StoreEntry *entry, const char *name) const;
+    void dumpConfigLine(char *entry, const char *name) const;
 };
 
 /* legacy parser access wrappers */
 #define parse_QosConfig(X)     (X)->parseConfigLine()
-#define dump_QosConfig(e,n,X)  (X).dumpConfigLine(e,n)
 #define free_QosConfig(X)
+#define dump_QosConfig(e,n,X) do { \
+               char temp[256]; /* random number. change as needed. max config line length. */ \
+               (X).dumpConfigLine(temp,n); \
+               storeAppendPrintf(e, "%s", temp); \
+       } while(0);
 
 #endif /* USE_ZPH_QOS */
 #endif /* SQUID_QOSCONFIG_H */
index dc7a666f6b190c6664b5a3ba3123906937f1833a..8cb2b863fa0303bb81e7d0d7e54abbedd2503915 100644 (file)
@@ -43,7 +43,7 @@ QosConfig::parseConfigLine()
 }
 
 void
-QosConfig::dumpConfigLine(StoreEntry * entry, const char *name) const
+QosConfig::dumpConfigLine(char *entry, const char *name) const
 {
     ; /* Not needed in stub */
 }