You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2010/11/20 16:18:21 UTC
svn commit: r1037239 - in /trafficserver/traffic/branches/wccp:
libinktomi++/ proxy/mgmt2/ proxy/mgmt2/api2/ proxy/mgmt2/api2/include/
proxy/mgmt2/cli/ proxy/mgmt2/cluster/ proxy/mgmt2/stats/ proxy/mgmt2/utils/
proxy/mgmt2/web2/ proxy/tsconfig/ proxy/w...
Author: amc
Date: Sat Nov 20 15:18:21 2010
New Revision: 1037239
URL: http://svn.apache.org/viewvc?rev=1037239&view=rev
Log:
First working with new config logic.
Removed:
trafficserver/traffic/branches/wccp/proxy/mgmt2/api2/include/AtsBase.h
trafficserver/traffic/branches/wccp/proxy/mgmt2/api2/include/Errata.h
trafficserver/traffic/branches/wccp/proxy/mgmt2/api2/include/IntrusivePtr.h
trafficserver/traffic/branches/wccp/proxy/mgmt2/api2/include/NumericType.h
Modified:
trafficserver/traffic/branches/wccp/libinktomi++/ink_defs.h
trafficserver/traffic/branches/wccp/proxy/mgmt2/LocalManager.cc
trafficserver/traffic/branches/wccp/proxy/mgmt2/LocalManager.h
trafficserver/traffic/branches/wccp/proxy/mgmt2/Main.cc
trafficserver/traffic/branches/wccp/proxy/mgmt2/api2/Makefile.am
trafficserver/traffic/branches/wccp/proxy/mgmt2/cli/Makefile.am
trafficserver/traffic/branches/wccp/proxy/mgmt2/cluster/Makefile.am
trafficserver/traffic/branches/wccp/proxy/mgmt2/stats/Makefile.am
trafficserver/traffic/branches/wccp/proxy/mgmt2/utils/Makefile.am
trafficserver/traffic/branches/wccp/proxy/mgmt2/web2/Makefile.am
trafficserver/traffic/branches/wccp/proxy/tsconfig/Errata.cc
trafficserver/traffic/branches/wccp/proxy/tsconfig/Errata.h
trafficserver/traffic/branches/wccp/proxy/tsconfig/Makefile.am
trafficserver/traffic/branches/wccp/proxy/tsconfig/TsBuilder.cc
trafficserver/traffic/branches/wccp/proxy/tsconfig/TsConfig.flex
trafficserver/traffic/branches/wccp/proxy/tsconfig/TsValue.h
trafficserver/traffic/branches/wccp/proxy/wccp/WccpConfig.cc
trafficserver/traffic/branches/wccp/proxy/wccp/WccpEndPoint.cc
Modified: trafficserver/traffic/branches/wccp/libinktomi++/ink_defs.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/libinktomi%2B%2B/ink_defs.h?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/libinktomi++/ink_defs.h (original)
+++ trafficserver/traffic/branches/wccp/libinktomi++/ink_defs.h Sat Nov 20 15:18:21 2010
@@ -85,4 +85,10 @@ extern int on;
int ink_sys_name_release(char *name, int namelen, char *release, int releaselen);
int ink_number_of_processors();
+/** Constants.
+ */
+namespace ts {
+ static const int NO_FD = -1; ///< No or invalid file descriptor.
+}
+
#endif /*__ink_defs_h*/
Modified: trafficserver/traffic/branches/wccp/proxy/mgmt2/LocalManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/mgmt2/LocalManager.cc?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/mgmt2/LocalManager.cc (original)
+++ trafficserver/traffic/branches/wccp/proxy/mgmt2/LocalManager.cc Sat Nov 20 15:18:21 2010
@@ -537,7 +537,7 @@ LocalManager::pollMgmtProcessServer()
while (1) {
// Only run WCCP housekeeping while we have a server process.
// Note: The WCCP socket is opened iff WCCP is configured.
- bool wccp_active = wccp_fd != ats::NO_FD && watched_process_fd != ats::NO_FD;
+ bool wccp_active = wccp_fd != ts::NO_FD && watched_process_fd != ts::NO_FD;
// poll only
timeout.tv_sec = process_server_timeout_secs;
@@ -560,7 +560,7 @@ LocalManager::pollMgmtProcessServer()
} else if (num > 0) { /* Have something */
- if (wccp_fd != ats::NO_FD && FD_ISSET(wccp_fd, &fdlist)) {
+ if (wccp_fd != ts::NO_FD && FD_ISSET(wccp_fd, &fdlist)) {
wccp_cache.handleMessage();
--num;
}
@@ -595,7 +595,7 @@ LocalManager::pollMgmtProcessServer()
--num;
}
- if (ats::NO_FD != watched_process_fd && FD_ISSET(watched_process_fd, &fdlist)) {
+ if (ts::NO_FD != watched_process_fd && FD_ISSET(watched_process_fd, &fdlist)) {
int res;
MgmtMessageHdr mh_hdr;
MgmtMessageHdr *mh_full;
Modified: trafficserver/traffic/branches/wccp/proxy/mgmt2/LocalManager.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/mgmt2/LocalManager.h?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/mgmt2/LocalManager.h (original)
+++ trafficserver/traffic/branches/wccp/proxy/mgmt2/LocalManager.h Sat Nov 20 15:18:21 2010
@@ -186,7 +186,7 @@ public:
#endif
WebPluginList plugin_list;
- Wccp::Cache wccp_cache;
+ wccp::Cache wccp_cache;
private:
Modified: trafficserver/traffic/branches/wccp/proxy/mgmt2/Main.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/mgmt2/Main.cc?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/mgmt2/Main.cc (original)
+++ trafficserver/traffic/branches/wccp/proxy/mgmt2/Main.cc Sat Nov 20 15:18:21 2010
@@ -446,27 +446,26 @@ set_process_limits(int fds_throttle)
}
void
-Errata_Logger(ats::Errata const& err) {
+Errata_Logger(ts::Errata const& err) {
size_t n;
static size_t const SIZE = 4096;
char buff[SIZE];
if (err.size()) {
- ats::Errata::Code code = err.top().getCode();
- if (code > 0) {
- n = err.write(buff, SIZE, 1, 0, 2, "> ");
- // strip trailing newlines.
- while (n && (buff[n-1] == '\n' || buff[n-1] == '\r'))
- buff[--n] = 0;
- // log it.
- if (code > 1) mgmt_elog("[WCCP]%s", buff);
- else mgmt_log("[WCCP]%s", buff);
- }
+ ts::Errata::Code code = err.top().getCode();
+ n = err.write(buff, SIZE, 1, 0, 2, "> ");
+ // strip trailing newlines.
+ while (n && (buff[n-1] == '\n' || buff[n-1] == '\r'))
+ buff[--n] = 0;
+ // log it.
+ if (code > 1) mgmt_elog("[WCCP]%s", buff);
+ else if (code > 0) mgmt_log("[WCCP]%s", buff);
+ else Debug("WCCP", "%s", buff);
}
}
void
Init_Errata_Logging() {
- ats::Errata::registerSink(&Errata_Logger);
+ ts::Errata::registerSink(&Errata_Logger);
}
int
Modified: trafficserver/traffic/branches/wccp/proxy/mgmt2/api2/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/mgmt2/api2/Makefile.am?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/mgmt2/api2/Makefile.am (original)
+++ trafficserver/traffic/branches/wccp/proxy/mgmt2/api2/Makefile.am Sat Nov 20 15:18:21 2010
@@ -26,6 +26,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/proxy/mgmt2/cluster \
-I$(top_srcdir)/proxy/mgmt2/utils \
-I$(top_srcdir)/proxy/mgmt2/web2 \
+ -I$(top_srcdir)/proxy/tsconfig \
-I$(top_srcdir)/proxy/mgmt2/api2/include
MGMT_DEFS = @MGMT_DEFS@
Modified: trafficserver/traffic/branches/wccp/proxy/mgmt2/cli/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/mgmt2/cli/Makefile.am?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/mgmt2/cli/Makefile.am (original)
+++ trafficserver/traffic/branches/wccp/proxy/mgmt2/cli/Makefile.am Sat Nov 20 15:18:21 2010
@@ -24,6 +24,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/proxy/mgmt2/api2/include \
-I$(top_srcdir)/proxy/mgmt2/cluster \
-I$(top_srcdir)/proxy/mgmt2/utils \
+ -I$(top_srcdir)/proxy/tsconfig \
-I$(top_srcdir)/proxy/mgmt2/web2
MGMT_DEFS = @MGMT_DEFS@
Modified: trafficserver/traffic/branches/wccp/proxy/mgmt2/cluster/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/mgmt2/cluster/Makefile.am?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/mgmt2/cluster/Makefile.am (original)
+++ trafficserver/traffic/branches/wccp/proxy/mgmt2/cluster/Makefile.am Sat Nov 20 15:18:21 2010
@@ -22,6 +22,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/proxy/mgmt2 \
-I$(top_srcdir)/proxy/mgmt2/api2/include \
-I$(top_srcdir)/proxy/mgmt2/utils \
+ -I$(top_srcdir)/proxy/tsconfig \
-I$(top_srcdir)/proxy/mgmt2/web2
MGMT_DEFS = @MGMT_DEFS@
Modified: trafficserver/traffic/branches/wccp/proxy/mgmt2/stats/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/mgmt2/stats/Makefile.am?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/mgmt2/stats/Makefile.am (original)
+++ trafficserver/traffic/branches/wccp/proxy/mgmt2/stats/Makefile.am Sat Nov 20 15:18:21 2010
@@ -23,6 +23,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/proxy/mgmt2/cluster \
-I$(top_srcdir)/proxy/mgmt2/utils \
-I$(top_srcdir)/proxy/mgmt2/api2/include \
+ -I$(top_srcdir)/proxy/tsconfig \
-I$(top_srcdir)/proxy/mgmt2/web2 \
-I$(top_srcdir)/proxy
Modified: trafficserver/traffic/branches/wccp/proxy/mgmt2/utils/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/mgmt2/utils/Makefile.am?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/mgmt2/utils/Makefile.am (original)
+++ trafficserver/traffic/branches/wccp/proxy/mgmt2/utils/Makefile.am Sat Nov 20 15:18:21 2010
@@ -25,6 +25,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/proxy/mgmt2/api2/include \
-I$(top_srcdir)/proxy/mgmt2/cluster \
-I$(top_srcdir)/proxy/mgmt2/web2 \
+ -I$(top_srcdir)/proxy/tsconfig \
-I$(top_srcdir)/proxy
MGMT_DEFS = @MGMT_DEFS@
Modified: trafficserver/traffic/branches/wccp/proxy/mgmt2/web2/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/mgmt2/web2/Makefile.am?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/mgmt2/web2/Makefile.am (original)
+++ trafficserver/traffic/branches/wccp/proxy/mgmt2/web2/Makefile.am Sat Nov 20 15:18:21 2010
@@ -26,6 +26,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/proxy/mgmt2/cli \
-I$(top_srcdir)/proxy/mgmt2/cluster \
-I$(top_srcdir)/proxy/mgmt2/utils \
+ -I$(top_srcdir)/proxy/tsconfig \
-I$(top_srcdir)/proxy/mgmt2/tools \
-I$(top_srcdir)/proxy/hdrs
Modified: trafficserver/traffic/branches/wccp/proxy/tsconfig/Errata.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/tsconfig/Errata.cc?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/tsconfig/Errata.cc (original)
+++ trafficserver/traffic/branches/wccp/proxy/tsconfig/Errata.cc Sat Nov 20 15:18:21 2010
@@ -131,7 +131,7 @@ Errata::operator = (Message const& msg)
}
Errata&
-Errata::join(self const& that) {
+Errata::pull(self& that) {
if (that.m_data) {
this->pre_write();
m_data->m_items.insert(
@@ -139,6 +139,7 @@ Errata::join(self const& that) {
that.m_data->m_items.begin(),
that.m_data->m_items.end()
);
+ that.m_data->m_items.clear();
}
return *this;
}
Modified: trafficserver/traffic/branches/wccp/proxy/tsconfig/Errata.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/tsconfig/Errata.h?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/tsconfig/Errata.h (original)
+++ trafficserver/traffic/branches/wccp/proxy/tsconfig/Errata.h Sat Nov 20 15:18:21 2010
@@ -182,11 +182,11 @@ public:
*/
Message const& top() const;
- /** Join @a that to @c this errata.
+ /** Move messages from @a that to @c this errata.
Messages from @a that are put on the top of the
- stack in @c this.
+ stack in @c this and removed from @a that.
*/
- self& join(self const& that);
+ self& pull(self& that);
/// Remove last message.
void pop();
Modified: trafficserver/traffic/branches/wccp/proxy/tsconfig/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/tsconfig/Makefile.am?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/tsconfig/Makefile.am (original)
+++ trafficserver/traffic/branches/wccp/proxy/tsconfig/Makefile.am Sat Nov 20 15:18:21 2010
@@ -39,10 +39,10 @@ libtsconfig_a_SOURCES = \
TsConfig.tab.c \
TsConfig.lex.c
-TsConfig.tab.c: TsConfig.y
+TsConfig.tab.c TsConfig.tab.h: TsConfig.y
bison -d --name-prefix tsconfig TsConfig.y
-TsConfig.lex.c: TsConfig.flex
+TsConfig.lex.c TsConfig.lex.h: TsConfig.flex
flex --outfile TsConfig.lex.c TsConfig.flex
#test_cache_SOURCES = \
Modified: trafficserver/traffic/branches/wccp/proxy/tsconfig/TsBuilder.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/tsconfig/TsBuilder.cc?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/tsconfig/TsBuilder.cc (original)
+++ trafficserver/traffic/branches/wccp/proxy/tsconfig/TsBuilder.cc Sat Nov 20 15:18:21 2010
@@ -5,6 +5,7 @@
// Access to terminal token values.
extern "C" {
# include "TsConfig.tab.h"
+ extern ts::config::Location TsConfig_Lex_Location;
};
# define PRE "Configuration Parser: "
@@ -71,8 +72,8 @@ Builder::syntaxErrorDispatch(void* data,
int
Builder::syntaxError(char const* text) {
- msg::logf(_errata, msg::WARN, "Syntax error '%s'.", text);
- return 0;
+ msg::logf(_errata, msg::WARN, "Syntax error '%s' near line %d, column %d.", text, TsConfig_Lex_Location._line, TsConfig_Lex_Location._col);
+ return 0;
}
Rv<Configuration>
@@ -94,8 +95,9 @@ Builder::build(Buffer const& buffer) {
}
void
-Builder::groupOpen(Token const&) {
+Builder::groupOpen(Token const& token) {
_v = _v.makeGroup(_name);
+ _v.setSource(token._loc._line, token._loc._col);
}
void Builder::groupClose(Token const&) {
_v = _v.getParent();
@@ -103,8 +105,9 @@ void Builder::groupClose(Token const&) {
void Builder::groupName(Token const& token) {
_name.set(token._s, token._n);
}
-void Builder::listOpen(Token const&) {
+void Builder::listOpen(Token const& token) {
_v = _v.makeList(_name);
+ _v.setSource(token._loc._line, token._loc._col);
}
void Builder::listClose(Token const&) {
_v = _v.getParent();
@@ -134,8 +137,12 @@ void Builder::pathIndex(Token const& tok
void Builder::pathClose(Token const&) {
Rv<Value> cv = _v.makePath(_path, _name);
- if (cv.isOK())
+ if (cv.isOK()) {
cv.result().setText(_extent).setSource(_loc._line, _loc._col);
+ // Terminate path. This will overwrite trailing whitespace or
+ // the closing angle bracket, both of which are expendable.
+ _extent._ptr[_extent._size] = 0;
+ }
_name.reset();
_extent.reset();
}
@@ -145,10 +152,10 @@ void Builder::literalValue(Token const&
ConstBuffer text(token._s, token._n);
// It's just too painful to use these strings with standard
- // libraries without nul terminating these. For strings we convert
- // the trailing quote. For integers we abuse the fact that the
- // parser can't reduce using this token before the lexer has read
- // at least one char ahead.
+ // libraries without nul terminating. For strings we convert the
+ // trailing quote. For integers we abuse the fact that the parser
+ // can't reduce using this token before the lexer has read at
+ // least one char ahead.
// Note the nul is *not* included in the reported length.
@@ -163,7 +170,7 @@ void Builder::literalValue(Token const&
} else {
msg::logf(_errata, msg::WARN, PRE "Unexpected literal type %d.", token._type);
}
- if (!cv.isOK()) _errata.join(cv.errata());
+ if (!cv.isOK()) _errata.pull(cv.errata());
if (cv.result()) cv.result().setSource(token._loc._line, token._loc._col);
_name.set(0,0); // used, so clear it.
}
Modified: trafficserver/traffic/branches/wccp/proxy/tsconfig/TsConfig.flex
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/tsconfig/TsConfig.flex?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/tsconfig/TsConfig.flex (original)
+++ trafficserver/traffic/branches/wccp/proxy/tsconfig/TsConfig.flex Sat Nov 20 15:18:21 2010
@@ -4,11 +4,11 @@
#include "TsConfig.tab.h"
#include "TsConfigParseEvents.h"
-struct Location Lex_Location = { 0, 1 };
+struct Location TsConfig_Lex_Location = { 0, 1 };
-# define YY_USER_ACTION Lex_Location._col += yyleng;
+# define YY_USER_ACTION TsConfig_Lex_Location._col += yyleng;
-# define FILL yylval->_s = yytext; yylval->_n = yyleng; yylval->_loc = Lex_Location; yylval->_loc._col -= yyleng;
+# define FILL yylval->_s = yytext; yylval->_n = yyleng; yylval->_loc = TsConfig_Lex_Location; yylval->_loc._col -= yyleng;
# define ZRET(t) FILL; yylval->_type = t; return t;
# define HANDLE_EVENT(x) \
if (yyextra) { \
@@ -30,7 +30,7 @@ IDENT [[:alpha:]_](?:-*[[:alnum:]_])*
%x bad
%%
-\n ++(Lex_Location._line); Lex_Location._col = 0;
+\n ++(TsConfig_Lex_Location._line); TsConfig_Lex_Location._col = 0;
(?:[[:space:]]{-}[\n])+
^[[:space:]]*#.*$
\/\/.*$
@@ -50,7 +50,7 @@ IDENT [[:alpha:]_](?:-*[[:alnum:]_])*
. BEGIN(bad); FILL;
<bad>\n {
BEGIN(0); // Terminate bad token mode.
- ++(Lex_Location._line); // Must bump line count.
+ ++(TsConfig_Lex_Location._line); // Must bump line count.
HANDLE_EVENT(InvalidToken);
}
<bad>[[:space:]] BEGIN(0); HANDLE_EVENT(InvalidToken);
Modified: trafficserver/traffic/branches/wccp/proxy/tsconfig/TsValue.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/tsconfig/TsValue.h?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/tsconfig/TsValue.h (original)
+++ trafficserver/traffic/branches/wccp/proxy/tsconfig/TsValue.h Sat Nov 20 15:18:21 2010
@@ -633,7 +633,7 @@ inline Value::operator detail::PseudoBoo
inline bool Value::operator ! () const { return ! this->hasValue(); }
inline ValueType Value::getType() const { return this->hasValue() ? _config._table[_vidx]._type : VoidValue; }
inline ConstBuffer const& Value::getText() const {
- return this->hasValue() ? _config._table[_vidx]._name : detail::NULL_CONST_BUFFER;
+ return this->hasValue() ? _config._table[_vidx]._text : detail::NULL_CONST_BUFFER;
}
inline Value& Value::setText(ConstBuffer const& text) {
detail::ValueItem* item = this->item();
@@ -657,6 +657,10 @@ inline Value& Value::reset() { _config =
inline detail::ValueItem* Value::item() { return this->hasValue() ? &(_config._table[_vidx]) : 0; }
inline detail::ValueItem const* Value::item() const { return const_cast<self*>(this)->item(); }
inline Value Value::operator [] (char const* name) const { return (*this)[ConstBuffer(name, strlen(name))]; }
+inline size_t Value::childCount() const {
+ detail::ValueItem const* item = this->item();
+ return item ? item->_children.size() : 0;
+}
inline Value Value::find(char const* path) { return this->find(ConstBuffer(path, strlen(path))); }
inline int Value::getSourceLine() const {
detail::ValueItem const* item = this->item();
Modified: trafficserver/traffic/branches/wccp/proxy/wccp/WccpConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/wccp/WccpConfig.cc?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/wccp/WccpConfig.cc (original)
+++ trafficserver/traffic/branches/wccp/proxy/wccp/WccpConfig.cc Sat Nov 20 15:18:21 2010
@@ -11,22 +11,7 @@ using ts::config::Value;
// Support that must go in the standard namespace.
namespace std {
-# if 0
-ostream& operator << ( ostream& s, ts::config::ValueType const& t ) {
- switch (t) {
- case ts::config::ValueTypeString: s << "string"; break;
- case ts::config::ValueTypeInt: s << "integer"; break;
- case ts::config::ValueTypeInt64: s << "integer (64 bit)"; break;
- case ts::config::ValueTypeFloat: s << "floating point"; break;
- case ts::config::ValueTypeBoolean: s << "boolean"; break;
- case ts::config::ValueTypeArray: s << "array"; break;
- case ts::config::ValueTypeList: s << "list"; break;
- case ts::config::GroupValue: s << "group"; break;
- default: s << "*unknown*"; break;
- };
- return s;
-}
-# endif
+
inline ostream& operator << ( ostream& s, ts::ConstBuffer const& b ) {
if (b._ptr) s.write(b._ptr, b._size);
else s << b._size;
@@ -41,6 +26,7 @@ using namespace wccp;
// Scratch global list of seed router addresses.
// Yeah, not thread safe, but it's just during configuration load.
+// Logic somewhat changed - can we move in to the load method?
std::vector<uint32> Seed_Router;
// Names used for various elements and properties.
@@ -504,11 +490,11 @@ CacheImpl::loadServicesFromFile(char con
if ((prop = cfg[SVC_PROP_SECURITY]).hasValue()) {
ts::Rv<ts::ConstBuffer> rv = load_security(prop);
if (rv.isOK()) this->useMD5Security(rv);
- else zret.join(rv.errata());
+ else zret.pull(rv.errata());
}
if ((prop = cfg[SVC_PROP_ROUTERS]).hasValue()) {
- zret.join(load_routers(prop, Seed_Router));
+ zret.pull(load_routers(prop, Seed_Router).doNotLog());
}
int idx, nsvc;
@@ -694,7 +680,7 @@ CacheImpl::loadServicesFromFile(char con
security_style = SECURITY_NONE;
}
}
- zret.join(security.errata());
+ zret.pull(security.errata());
}
// Get any group specific routers.
Modified: trafficserver/traffic/branches/wccp/proxy/wccp/WccpEndPoint.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/wccp/WccpEndPoint.cc?rev=1037239&r1=1037238&r2=1037239&view=diff
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/wccp/WccpEndPoint.cc (original)
+++ trafficserver/traffic/branches/wccp/proxy/wccp/WccpEndPoint.cc Sat Nov 20 15:18:21 2010
@@ -62,7 +62,7 @@ Impl::open(uint addr) {
this->close();
return -errno;
}
- logf(LVL_INFO, "WCCP socket bound to %s:%d", ip_addr_to_str(m_addr), DEFAULT_PORT);
+ logf(LVL_INFO, "Socket bound to %s:%d", ip_addr_to_str(m_addr), DEFAULT_PORT);
// Now get the address. Usually the same but possibly different,
// certainly if addr was INADDR_ANY.
@@ -108,7 +108,8 @@ Impl::useMD5Security(ts::ConstBuffer con
m_security_opt = SECURITY_MD5;
m_use_security_key = true;
memset(m_security_key, 0, SecurityComp::KEY_SIZE);
- strncpy(m_security_key, key._ptr, std::min(key._size, SecurityComp::KEY_SIZE));
+ // Great. Have to cast or we get a link error.
+ strncpy(m_security_key, key._ptr, std::min(key._size, static_cast<size_t>(SecurityComp::KEY_SIZE)));
}
SecurityOption
@@ -571,7 +572,7 @@ CacheImpl::housekeeping() {
if (group.m_assign_info.fill(group, m_addr))
ts::for_each(group.m_routers, ts::assign_member(&RouterData::m_assign, true));
- // Always clear because no point in sending a assign we can't generate.
+ // Always clear because no point in sending an assign we can't generate.
group.m_assignment_pending = false;
}
@@ -637,6 +638,13 @@ CacheImpl::housekeeping() {
sspot->m_xmit = now;
sspot->m_count += 1;
}
+ else logf(LVL_DEBUG,
+ "Error [%d:%s] sending HERE_I_AM for SG %d to seed router %s [#%d,%lu].",
+ zret, strerror(errno),
+ group.m_svc.getSvcId(),
+ ip_addr_to_str(sspot->m_addr),
+ group.m_generation, now
+ );
}
}
return zret;