Permalink
Browse files

Add proper methods for nonblocking

  • Loading branch information...
1 parent faf7f99 commit 9114e3c9d2bdafadc9a2fa54a0cb265f69b37fe4 @evanphx evanphx committed Sep 10, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/puma/minissl.rb
View
@@ -52,7 +52,7 @@ def write(data)
enc = @engine.extract
if enc
- @socket.write enc
+ @socket.syswrite enc
end
need -= wrote
@@ -63,6 +63,8 @@ def write(data)
end
end
+ alias_method :syswrite, :write
+
def flush
@socket.flush
end
@@ -108,6 +110,13 @@ def accept
Socket.new io, engine
end
+ def accept_nonblock
+ io = @socket.accept_nonblock
+ engine = Engine.server @ctx.key, @ctx.cert
+
+ Socket.new io, engine
+ end
+
def close
@socket.close
end

0 comments on commit 9114e3c

Please sign in to comment.