Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Commit

Permalink
Merge branch '0.6.0-milestone' into unix_server
Browse files Browse the repository at this point in the history
  • Loading branch information
//de committed Mar 24, 2015
2 parents 8cf2294 + 508faf3 commit 56cbe41
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
19 changes: 18 additions & 1 deletion CHANGES.md
@@ -1,5 +1,22 @@
0.6.0
----
* Fix stack level too deep when writing to ChunkStream
* Use HTTP::Resonse::Status::REASONS table ( HTTP::Response::* deprecated in the HTTP gem )
* Use Timers 3.0.0 API
* Case-insensitivity for header field names ( i.e. in case a proxy downcases them )
* Catch when openssl sometimes fires ECONNRESET, EPIPE, ETIMEDOUT, EHOSTUNREACH and as an error
* Unused `optimize` socket modifications taken off all server implementations
* Fixed 404 error in roundtrip example
* Fixed "Reel::StateError: already processing a request" when client is killed
* Numerous updates to rspec.
* Switched to websocket/driver and improved websocket handling
* Implement DriverEnvironment to fix websocket example
* Refactored Server::HTTPS to be more idomatic
* Fixed jRuby related test failures
* Fixed "ArgumentError: Data object has already been freed" caused by underlying parser.

0.5.0 (2014-04-15)
------------------
----
* Reel::Server(::SSL) renamed to Reel::Server::HTTP and Reel::Server::HTTPS
* New Reel::Spy API for observing requests and responses from the server
* Fixes to chunked encoding handling
Expand Down
2 changes: 1 addition & 1 deletion lib/reel/connection.rb
Expand Up @@ -56,7 +56,7 @@ def request

req = @parser.current_request
@request_fsm.transition :headers
@keepalive = false if req[CONNECTION] == CLOSE || req.version == HTTP_VERSION_1_0
@keepalive = false if req.nil? || req[CONNECTION] == CLOSE || req.version == HTTP_VERSION_1_0
@current_request = req

req
Expand Down
6 changes: 5 additions & 1 deletion lib/reel/request/parser.rb
Expand Up @@ -43,7 +43,11 @@ def current_request

def readpartial(size = @buffer_size)
bytes = @socket.readpartial(size)
@parser << bytes
begin
@parser << bytes
rescue ArgumentError
raise Errno::EPIPE
end
end

#
Expand Down
14 changes: 7 additions & 7 deletions lib/reel/server/https.rb
Expand Up @@ -27,12 +27,11 @@ def initialize(host, port, options={}, &callback)

# if verify_mode isn't explicitly set, verify peers if we've
# been provided CA information that would enable us to do so
ssl_context.verify_mode = case
when options.include?(:verify_mode)
ssl_context.verify_mode = if options.include?(:verify_mode)
options[:verify_mode]
when options.include?(:ca_file)
elsif options.include?(:ca_file)
OpenSSL::SSL::VERIFY_PEER
when options.include?(:ca_path)
elsif options.include?(:ca_path)
OpenSSL::SSL::VERIFY_PEER
else
OpenSSL::SSL::VERIFY_NONE
Expand All @@ -50,10 +49,11 @@ def run
loop do
begin
socket = @server.accept
rescue OpenSSL::SSL::SSLError, Errno::ECONNRESET, Errno::EPIPE,
Errno::ETIMEDOUT, Errno::EHOSTUNREACH => ex
rescue OpenSSL::SSL::SSLError, EOFError,
Errno::ECONNRESET, Errno::EPIPE, Errno::EINPROGRESS,
Errno::ETIMEDOUT, Errno::EHOSTUNREACH => ex
Logger.warn "Error accepting SSLSocket: #{ex.class}: #{ex.to_s}"
retry
next
end

async.handle_connection socket
Expand Down
5 changes: 3 additions & 2 deletions spec/reel/https_server_spec.rb
Expand Up @@ -2,6 +2,7 @@
require 'net/http'

RSpec.describe Reel::Server::HTTPS do

let(:example_https_port) { example_port + 1 }
let(:example_url) { "https://#{example_addr}:#{example_https_port}#{example_path}" }
let(:endpoint) { URI(example_url) }
Expand Down Expand Up @@ -44,7 +45,7 @@
raise ex if ex
end

it 'verifies client SSL certs when provided with a CA' do
it "verifies client SSL certs when provided with a CA" do
ex = nil

handler = proc do |connection|
Expand Down Expand Up @@ -75,7 +76,7 @@
raise ex if ex
end

it %{fails to verify client certificates that aren't signed} do
it "fails to verify client certificates that aren't signed" do
ex = nil

handler = proc do |connection|
Expand Down

0 comments on commit 56cbe41

Please sign in to comment.