Rework this patch to only enable non-blocking openssl on Windows, as this has also reproduced on BT5 with 1.9.2

git-svn-id: file:///home/svn/framework3/trunk@13411 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2011-07-29 19:10:20 +00:00
parent 5f3cd45d07
commit f57799943c
4 changed files with 8 additions and 8 deletions

View File

@ -37,7 +37,7 @@ ENABLE_PROCESSED_INPUT = 1
def self.is_windows
return @@is_windows if @@is_windows
@@is_windows = (RUBY_PLATFORM =~ /mswin32|mingw32/) ? true : false
@@is_windows = (RUBY_PLATFORM =~ /mswin(32|64)|mingw(32|64)/) ? true : false
end
def self.is_cygwin

View File

@ -151,8 +151,8 @@ class Client
ctx = generate_ssl_context()
ssl = OpenSSL::SSL::SSLSocket.new(sock, ctx)
# Use non-blocking openssl calls when possible, but not on OS X
if Rex::Compat.is_macosx or not ssl.respond_to?(:accept_nonblock)
# Use non-blocking OpenSSL operations on Windows
if not ( ssl.respond_to?(:accept_nonblock) and Rex::Compat.is_windows )
ssl.accept
else
begin

View File

@ -309,11 +309,11 @@ begin
#
# This flag determines whether to use the non-blocking openssl
# API calls when they are available. This is still buggy on
# Mac OS X and will be disabled by default on that platform
# Linux/Mac OS X, but is required on Windows
#
def allow_nonblock?
avail = self.sslsock.respond_to?(:connect_nonblock)
if avail and not Rex::Compat.is_macosx
avail = self.sock.respond_to?(:accept_nonblock)
if avail and Rex::Compat.is_windows
return true
end
false

View File

@ -158,11 +158,11 @@ module Rex::Socket::SslTcpServer
#
# This flag determines whether to use the non-blocking openssl
# API calls when they are available. This is still buggy on
# Mac OS X and will be disabled by default on that platform
# Linux/Mac OS X, but is required on Windows
#
def allow_nonblock?
avail = self.sock.respond_to?(:accept_nonblock)
if avail and not Rex::Compat.is_macosx
if avail and Rex::Compat.is_windows
return true
end
false