Author: poeml Date: Thu Nov 26 16:14:34 2009 New Revision: 46 URL: http://svn.mirrorbrain.org/viewvc/mod_stats?rev=46&view=rev Log: make it work with StatsDupWindow = 0 Modified: trunk/tools/dlcount.py Modified: trunk/tools/dlcount.py URL: http://svn.mirrorbrain.org/viewvc/mod_stats/trunk/tools/dlcount.py?rev=46&r1=45&r2=46&view=diff ============================================================================== --- trunk/tools/dlcount.py (original) +++ trunk/tools/dlcount.py Thu Nov 26 16:14:34 2009 _at_@ -277,21 +277,20 @@ if skip: continue # over a window of StatsDupWindow last requests, the same request must - # not have occured already - m = hashlib.md5() - m.update(ip) - m.update(url) - m.update(referer) - m.update(ua) - md = m.digest() - - # was the requests seen recently? If yes, ignore it. - # otherwise, put it into the ring buffer. - if md in known.data: - continue - known.append(md) - - # apply prefiltering + # not have occured already. If it did, ignore it. If it didn't, put + # it into the ring buffer. + if conf['statsdupwindow'] > 0: + m = hashlib.md5() + m.update(ip) + m.update(url) + m.update(referer) + m.update(ua) + md = m.digest() + if md in known.data: + continue + known.append(md) + + # apply the prefiltering rules for r, s, mreg in conf['statsprefilter']: url = r.sub(s, url) _______________________________________________ mirrorbrain-commits mailing list Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/ Note: To remove yourself from this list, send a mail with the content unsubscribe to the address mirrorbrain-commits-request_at_mirrorbrain.orgReceived on Thu Nov 26 2009 - 15:14:38 GMT
This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT