ftw 0.0.47 → 0.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bba1b85cd8f007369158bf2ceb6e1f3e886377ee
4
- data.tar.gz: 5bbeb582a2b0a0797140f5c5bf9fb46cdf7a91a3
3
+ metadata.gz: 95e6909d52fb80ff64c3100bb0c45f840b41131f
4
+ data.tar.gz: 115241a45b018605322cba89c04fe330afc6348f
5
5
  SHA512:
6
- metadata.gz: 02e08e7dd0a4edf7f511a1332cc1a3dc65be1c015851c22c7a7ec3dc1be793331c4cd23d4a43a151a18f2bf1d1e5cdd03292a150dea36f36225899a392cff9df
7
- data.tar.gz: b7f052ef1c134ed97d049b5e6d2bfe68b90eb91339f689d45ebb8bfdcc5e9676805c9584b88ad64bd378d6125b49d752933096284cbe923e8fb024fa48d827e0
6
+ metadata.gz: aec58e467111109f19d8c911bb3b8b1a47a62b6a5d5b129d688482148046b6b1675b0ecb632c0d820d8d6156b43c47b75ad4ccfcdba06ff7e87da847fcbc2a43
7
+ data.tar.gz: adb3cb13aabd4c57dbf800646230f2ea468b91181069ad1d214ccbd8f2e7776634a92bceeda9fcf02636d3d30a98ba489480fef036ad27e97b98517acfca7a67
@@ -21,6 +21,9 @@ module FTW::HTTP::Message
21
21
  # HTTP Versions that are valid.
22
22
  VALID_VERSIONS = [1.0, 1.1]
23
23
 
24
+ # For backward-compatibility, this exception inherits from ArgumentError
25
+ UnsupportedHTTPVersion = Class.new(ArgumentError)
26
+
24
27
  private
25
28
 
26
29
  # A new HTTP message.
@@ -101,7 +104,7 @@ module FTW::HTTP::Message
101
104
  ver = ver.to_f if !ver.is_a?(Float)
102
105
 
103
106
  if !VALID_VERSIONS.include?(ver)
104
- raise ArgumentError.new("#{self.class.name}#version = #{ver.inspect} is" \
107
+ raise UnsupportedHTTPVersion.new("#{self.class.name}#version = #{ver.inspect} is" \
105
108
  "invalid. It must be a number, one of #{VALID_VERSIONS.join(", ")}")
106
109
  end
107
110
  @version = ver
@@ -106,7 +106,7 @@ class FTW::Server
106
106
  # TODO(sissel): Select on all sockets
107
107
  # TODO(sissel): Accept and yield to the block
108
108
  stopper = @stopper[0]
109
- while true
109
+ while !@sockets.empty?
110
110
  @control_lock.synchronize do
111
111
  sockets = @sockets.values + [stopper]
112
112
  read, write, error = IO.select(sockets, nil, nil, nil)
@@ -3,5 +3,5 @@ require "ftw/namespace"
3
3
  # :nodoc:
4
4
  module FTW
5
5
  # The version of this library
6
- VERSION = "0.0.47"
6
+ VERSION = "0.0.48"
7
7
  end
@@ -49,6 +49,8 @@ class FTW::WebServer
49
49
  # Connection EOF'd or errored before we finished reading a full HTTP
50
50
  # message, shut it down.
51
51
  break
52
+ rescue FTW::HTTP::Message::UnsupportedHTTPVersion
53
+ break
52
54
  end
53
55
 
54
56
  if request["Content-Length"] || request["Transfer-Encoding"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ftw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.47
4
+ version: 0.0.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Sissel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-11 00:00:00.000000000 Z
11
+ date: 2018-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cabin
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  version: '0'
147
147
  requirements: []
148
148
  rubyforge_project:
149
- rubygems_version: 2.6.13
149
+ rubygems_version: 2.6.11
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: For The Web. Trying to build a solid and sane API for client and server web