Changeset 3
- Timestamp:
- 05/11/05 23:30:41 (3 years ago)
- Files:
-
- mwcollect2/trunk/mwcollectd.conf.dist (modified) (1 diff)
- mwcollect2/trunk/src/include/dispatch.h (modified) (1 diff)
- mwcollect2/trunk/src/mwcollectd/dispatch.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mwcollect2/trunk/mwcollectd.conf.dist
r2 r3 237 237 fetch-multi-dispatch = "0"; # bool whether to dispatch one fetch request to all matching protocol handlers, default off! 238 238 fetch-local = "0"; # bool whether to fetch `local' files (e.g. files within a 192.168.0.0/16 range), default: 0 239 filter-unique-interval = " 45"; # filter urls to be unique in the last n minutes, set to 0 to disable -- if not unique, file will be discarded239 filter-unique-interval = "300"; # filter urls to be unique in the last n seconds, set to 0 to disable -- if not unique, file will be discarded, default 300 (5 minutes) 240 240 241 241 bind-address = "0.0.0.0"; # address to bind server sockets to, default "0.0.0.0" (binds to all) mwcollect2/trunk/src/include/dispatch.h
r1 r3 87 87 88 88 static ip_range_t m_irLocalRanges[]; 89 unsigned long m_ulBanTime; 89 90 }; 90 91 mwcollect2/trunk/src/mwcollectd/dispatch.cpp
r1 r3 93 93 m_pLogManager = pLogManager; 94 94 m_pConfig = pConfiguration; 95 96 m_ulBanTime = m_pConfig->getLong("filter-unique-interval", 300); 95 97 } 96 98 … … 115 117 char * szProtocol; 116 118 char * szAddress; 117 bool bFound = false; 119 bool bFound = false; 120 121 if(m_ulBanTime) 122 { 123 if(!m_mUniq[szUrl] || m_mUniq[szUrl] + m_ulBanTime < (unsigned long) time(0)) 124 { 125 m_pLogManager->log(LL_DEBUG, "Banning \"%s\" for %u seconds.", szUrl, m_ulBanTime); 126 m_mUniq[szUrl] = time(0); 127 } 128 else 129 { 130 m_pLogManager->log(LL_SPAM, "Dropped \"%s\" due to ban, %u more seconds remaining.", szUrl, m_ulBanTime - (time(0) - m_mUniq[szUrl])); 131 132 return; 133 } 134 } 118 135 119 136 for(szWalk = szUrl; * szWalk && * szWalk != ':'; ++szWalk) … … 134 151 return; 135 152 136 if(m_pConfig uration->getLong("fetch-local", 0) || !isLocalAddress(inet_addr(szAddress)))153 if(m_pConfig->getLong("fetch-local", 0) || !isLocalAddress(inet_addr(szAddress))) 137 154 { 138 155 for(std::list<ProtocolHandler *>::iterator i = m_lpHandlers.begin(); i != m_lpHandlers.end(); ++i) … … 149 166 if(!bFound) 150 167 m_pLogManager->log(LL_CRITICAL, "Did not know how to fetch \"%s\" (\"%s\")!", szUrl, szProtocol); 151 else 152 { 153 // m_mUniq[szUrl] = time(0); 154 168 else 155 169 m_pLogManager->log(LL_DEBUG, "Pushed fetch request for \"%s\".", szUrl); 156 }157 170 } 158 171 else
