Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions server/libs/dnser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,9 @@ def serialize()
].pack("nnnnnn")

questions.each do |q|
result += q.serialize()
unless q.nil? then
result += q.serialize()
end
end

answers.each do |a|
Expand Down Expand Up @@ -841,6 +843,8 @@ def on_request()
@thread = Thread.new() do |t|
begin
loop do
goterror=false
begin
data = @s.recvfrom(65536)

# Data is an array where the first element is the actual data, and the second is the host/port
Expand All @@ -866,8 +870,13 @@ def on_request()
end
end
end
rescue Exception => e
puts("Caught an error: #{e}")
puts(e.backtrace())
goterror=true
end

if(!transaction.sent)
if(!goterror and !transaction.sent)
begin
proc.call(transaction)
rescue StandardError => e
Expand Down