prelude-correlator/master: Fix timer issue on reset()

[email protected] Sat, 16 Jan 2010 17:24:06 +0100 (CET)
Newsgroups gmane.comp.security.ids.prelude.cvs
Message-ID <[email protected]>
commit c7e9a2c7aa7daa1943b62e0224640d6f2370ab3c
Author: Yoann Vandoorselaere <[email protected]>
Date:   Fri Jan 15 17:33:28 2010 +0100

    Fix timer issue on reset()
    
    Since the introduction of IDMEF.reset(), timer reset was not working
    due to a conflict in the method being called. Remove the IDMEF.reset()
    method since it is a NOP anyway, and store each received events in a
    newly allocated IDMEF instance.


========================================

 PreludeCorrelator/idmef.py |    3 ---
 PreludeCorrelator/main.py  |    4 +---
 2 files changed, 1 insertions(+), 6 deletions(-)

========================================

diff --git a/PreludeCorrelator/idmef.py b/PreludeCorrelator/idmef.py
index 7b4ca69..6f866ce 100644
--- a/PreludeCorrelator/idmef.py
+++ b/PreludeCorrelator/idmef.py
@@ -118,9 +118,6 @@ class IDMEF(PreludeEasy.IDMEF):
 
                 return True
 
-        def reset(self):
-                return
-
         def alert(self):
                 global prelude_client
                 prelude_client.correlationAlert(self)
diff --git a/PreludeCorrelator/main.py b/PreludeCorrelator/main.py
index d65040a..1a71d23 100644
--- a/PreludeCorrelator/main.py
+++ b/PreludeCorrelator/main.py
@@ -94,11 +94,10 @@ class PreludeClient:
                         self._print_output.write(str(idmef))
 
         def recvEvent(self):
-                msg = idmef.IDMEF()
-
                 last = time.time()
                 while self._continue:
                         try:
+                            msg = idmef.IDMEF()
                             r = self._client.RecvIDMEF(msg, 1000)
                         except:
                                 r = 0
@@ -106,7 +105,6 @@ class PreludeClient:
                         if r:
                                 if msg.Get("alert.create_time"):
                                         self._handle_event(msg)
-                                msg.reset()
 
                         now = time.time()
                         if now - last >= 1:
_______________________________________________
Prelude-cvslog site list
[email protected]
http://lists.prelude-ids.org/mailman/listinfo/prelude-cvslog