From: Amos Jeffries Date: Sat, 10 Jan 2009 03:04:47 +0000 (+1300) Subject: Fix build errors in layer-02 X-Git-Tag: SQUID_3_2_0_1~1269^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dbe6f864fefb40f9326c5a527550f1d9c590a0fe;p=thirdparty%2Fsquid.git Fix build errors in layer-02 --- diff --git a/src/icmp/Makefile.am b/src/icmp/Makefile.am index aae47e9d04..dbdc3debd0 100644 --- a/src/icmp/Makefile.am +++ b/src/icmp/Makefile.am @@ -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 \ diff --git a/src/ip/QosConfig.cc b/src/ip/QosConfig.cc index 3ce3687fd0..6a4d3530f9 100644 --- a/src/ip/QosConfig.cc +++ b/src/ip/QosConfig.cc @@ -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 */ diff --git a/src/ip/QosConfig.h b/src/ip/QosConfig.h index 61d400a8d4..62294bf8c2 100644 --- a/src/ip/QosConfig.h +++ b/src/ip/QosConfig.h @@ -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 */ diff --git a/src/ip/stubQosConfig.cc b/src/ip/stubQosConfig.cc index dc7a666f6b..8cb2b863fa 100644 --- a/src/ip/stubQosConfig.cc +++ b/src/ip/stubQosConfig.cc @@ -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 */ }