aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/udp_server.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-06-13 11:02:37 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-06-13 11:02:37 +0100
commitb22cbc87927553f6dbb5754281e95fe9bad2eed1 (patch)
tree5575791fe84492648a8cc92433c267815056507a /lib/mauve/udp_server.rb
parent495c44445642cfae8f23fadde299ad5307f5be58 (diff)
* Tidied up mauveserver to handle HUP restarts
* Added HTML santizing to the alert class, so bad HTML is stripped as part of processing. * Alert#cleared? now means "not raised" * Better error handling in the Timer class, making sure that the timer never gets permanently frozen. * Moved notification and packet buffers to the Server class, meaning that if the Processor or Notifier threads crash, we don't lose all the items waiting to be processed/notified. * XMPP/Email Alerts now use templates, instead of instance methods. * Emails now get sent as multipart with HTML to allow detail fields to be shown as nature intended.
Diffstat (limited to 'lib/mauve/udp_server.rb')
-rw-r--r--lib/mauve/udp_server.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/mauve/udp_server.rb b/lib/mauve/udp_server.rb
index a873e77..9e5f41c 100644
--- a/lib/mauve/udp_server.rb
+++ b/lib/mauve/udp_server.rb
@@ -70,8 +70,8 @@ module Mauve
#
i = 0
begin
- packet = @socket.recvfrom_nonblock(65535)
-# packet = @socket.recvfrom(65535)
+# packet = @socket.recvfrom_nonblock(65535)
+ packet = @socket.recvfrom(65535)
received_at = MauveTime.now
rescue Errno::EAGAIN, Errno::EWOULDBLOCK => ex
puts "#{i += 1} + #{ex}"
@@ -91,9 +91,10 @@ module Mauve
return
end
-
-
- Processor.push([[packet[0], packet[1], received_at]])
+ #
+ # Push packet onto central queue
+ #
+ Server.packet_push([packet[0], packet[1], received_at])
end
def stop