summaryrefslogtreecommitdiff
path: root/src/libcharon/plugins/vici/ruby/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcharon/plugins/vici/ruby/lib')
-rw-r--r--src/libcharon/plugins/vici/ruby/lib/vici.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libcharon/plugins/vici/ruby/lib/vici.rb b/src/libcharon/plugins/vici/ruby/lib/vici.rb
index f87e46e69..f8169add0 100644
--- a/src/libcharon/plugins/vici/ruby/lib/vici.rb
+++ b/src/libcharon/plugins/vici/ruby/lib/vici.rb
@@ -247,7 +247,11 @@ module Vici
def recv_all(len)
encoding = ""
while encoding.length < len do
- encoding << @socket.recv(len - encoding.length)
+ data = @socket.recv(len - encoding.length)
+ if data.empty?
+ raise TransportError, "connection closed"
+ end
+ encoding << data
end
encoding
end