Skip to content
Snippets Groups Projects
Commit 91e57d4c authored by Renne Nissinen's avatar Renne Nissinen
Browse files

Guard against sending more than one IRC command at a time

parent 9edfbe2e
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ module Cinch
@queued_queues = Set.new
@mutex = Mutex.new
@time_since_last_send = nil
@log = []
......@@ -81,7 +81,7 @@ module Cinch
def process_one
queue = @queues_to_process.pop
message = queue.pop.to_s.chomp
message = queue.pop.to_s.each_line.first.chomp
if queue.empty?
@mutex.synchronize do
......
......@@ -43,5 +43,10 @@ class WireTest < TestCase
assert_equal "PRIVMSG cinch :\001ACTION evil\001\r\n", sent
end
test "should not be able to send more than one IRC command at a time" do
@bot.irc.send("first\r\nsecond")
assert_equal "first\r\n", sent
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment