Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try Windows platform #38

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions test/open-uri/test_ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ def test_bad_ssl_version
end

def test_proxy_cacert_file
pend if RUBY_PLATFORM =~ /mswin|mingw/

url = nil
proxy_log_tester = lambda {|proxy_log, proxy_access_log|
assert_equal(1, proxy_access_log.length)
Expand All @@ -94,8 +92,6 @@ def test_proxy_cacert_file
end

def test_proxy_cacert_dir
pend if RUBY_PLATFORM =~ /mswin|mingw/

url = nil
proxy_log_tester = lambda {|proxy_log, proxy_access_log|
assert_equal(1, proxy_access_log.length)
Expand Down
25 changes: 18 additions & 7 deletions test/open-uri/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,28 @@ def proxy_connect(path, client)
client.puts "HTTP/1.1 200 Connection Established\r\n\r\n"
@access_log << "CONNECT #{path} \n"
begin
while fds = IO.select([client, backend])
loop do
fds = IO.select([client, backend])
if fds[0].include?(client)
data = client.readpartial(1024)
backend.write(data)
elsif fds[0].include?(backend)
data = backend.readpartial(1024)
client.write(data)
begin
data = client.readpartial(1024)
backend.write(data)
rescue EOFError
break
end
end
if fds[0].include?(backend)
begin
data = backend.readpartial(1024)
client.write(data)
rescue EOFError
break
end
end
end
rescue
ensure
backend.close
client.close
end
end

Expand Down
Loading