summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislee35 <rubygems@chrislee.dhs.org>2013-07-02 22:16:01 +0900
committerchrislee35 <rubygems@chrislee.dhs.org>2013-07-02 22:16:01 +0900
commiteee946d2cf5c7ea30cfc978cf689db697c992820 (patch)
tree9eb910304f472d3914b34c44749466a619623299
parent73af324a3a4a16e93033c7f8d5e42914872d2382 (diff)
downloadwebsockify-eee946d2cf5c7ea30cfc978cf689db697c992820.tar.gz
fixed 1.8 compatibility bug for OpenSSL::SSL::SSLSocket#read_nonblock vs #readpartial
tested in 1.8 and 2.0
-rw-r--r--other/websocket.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/other/websocket.rb b/other/websocket.rb
index 0fcd8fd..d4551a6 100644
--- a/other/websocket.rb
+++ b/other/websocket.rb
@@ -15,6 +15,16 @@ require 'digest/md5'
require 'digest/sha1'
require 'base64'
+unless OpenSSL::SSL::SSLSocket.instance_methods.index("read_nonblock")
+ module OpenSSL
+ module SSL
+ class SSLSocket
+ alias :read_nonblock :readpartial
+ end
+ end
+ end
+end
+
class EClose < Exception
end