File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 21
21
22
22
#
23
23
# $Log: scapy.py,v $
24
+ # Revision 1.0.4.106 2006/10/17 16:50:19 pbi
25
+ # - fixed ScapyFreqFilter (ticket #19)
26
+ #
24
27
# Revision 1.0.4.105 2006/10/17 16:12:03 pbi
25
28
# - added 'count' parameter to send()/sendp() and __gen_send() to send the same set of
26
29
# packets a given number of times
1724
1727
1725
1728
from __future__ import generators
1726
1729
1727
- RCSID = "$Id: scapy.py,v 1.0.4.105 2006/10/17 16:12:03 pbi Exp $"
1730
+ RCSID = "$Id: scapy.py,v 1.0.4.106 2006/10/17 16:50:19 pbi Exp $"
1728
1731
1729
1732
VERSION = RCSID .split ()[2 ]+ "beta"
1730
1733
@@ -1759,8 +1762,12 @@ def __init__(self):
1759
1762
def filter (self , record ):
1760
1763
wt = conf .warning_threshold
1761
1764
if wt > 0 :
1762
- stk = traceback .extract_stack (limit = 1 )
1763
- caller = stk [0 ][1 ]
1765
+ stk = traceback .extract_stack ()
1766
+ caller = None
1767
+ for f ,l ,n ,c in stk :
1768
+ if n == 'warning' :
1769
+ break
1770
+ caller = l
1764
1771
tm ,nb = self .warning_table .get (caller , (0 ,0 ))
1765
1772
ltm = time .time ()
1766
1773
if ltm - tm > wt :
You can’t perform that action at this time.
0 commit comments