falcon 0.18.5 → 0.18.6

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
  SHA256:
3
- metadata.gz: b4d63d513ba1b965c6bf1daac83887462ec92fed030577444dee6fd7bfb4c3b1
4
- data.tar.gz: 2fd3e47bab391fe6f2eb8e139c73d923f5bbd3672fc3c5ce7eea2d28a990742b
3
+ metadata.gz: 847f8d20937ff532517ca21f1564054cd79f340a0aee13f88798c048d5361b63
4
+ data.tar.gz: 252a0cc3cee3c1cf56646cff4bc9d458dd3308bcc6540eb30a7aa57e9bc92f21
5
5
  SHA512:
6
- metadata.gz: c888c2a1b3989666c33ecb5f1ebd33e65a917a17f3062bf6a1251afb05299a0da2ccb0e493ffee85d42f7c6ab6d7a03d64169ee3a05a1428516af8f25722c3c2
7
- data.tar.gz: e145e42827ed9b38ff59c0ca44c43c4965a1e6ef3c9806a90db299896f40f204c94a5011db2da86d6f1d178572e6c5c19aa34b628dab6185af16c12b6adbbb84
6
+ metadata.gz: 1f8f7ca9d48f240c536bdfe789528ff93b0e73cf2563f65975e62ae26a0fd27af4332271b5422ab53708a2fbaff667636998a8e1abd14e9905f66c2a9830e524
7
+ data.tar.gz: 29ab0345ce17eac91f5523de36429f0b3aba5b096f675152e688e232cc43331472b86091731a5efd73762f15381575a69429eaf04e0fe5d291e404494694abaa
data/Gemfile CHANGED
@@ -9,4 +9,6 @@ end
9
9
  group :test do
10
10
  gem 'simplecov'
11
11
  gem 'coveralls', require: false
12
+
13
+ gem 'async-process', '~> 1.1.0'
12
14
  end
data/README.md CHANGED
@@ -45,9 +45,11 @@ You can run `falcon serve` directly, and it will load the `config.ru` and start
45
45
 
46
46
  Falcon works perfectly with `rails` apps.
47
47
 
48
- Add `gem 'falcon'` to your `Gemfile` and perhaps remove `gem 'puma'` once you are satisified with the change.
48
+ 1. Add `gem 'falcon'` to your `Gemfile` and perhaps remove `gem 'puma'` once you are satisfied with the change.
49
49
 
50
- Run `RACK_HANDLER=falcon rails server` to start the server (at least, until [rack#181](https://github.com/rack/rack/pull/1181) is merged). Alternatively, if you want to use `HTTP/2`, run `falcon serve` directly.
50
+ 2. Run `falcon serve` to start a local development server.
51
+
52
+ Alternatively run `RACK_HANDLER=falcon rails server` to start the server (at least, until [rack#181](https://github.com/rack/rack/pull/1181) is merged).
51
53
 
52
54
  ### WebSockets
53
55
 
@@ -81,7 +83,7 @@ This will run a single-threaded instance of Falcon.
81
83
 
82
84
  ## Performance
83
85
 
84
- Falcon is uses an asynchronous event-driven reactor to provide non-blocking IO. It can handle an arbitrary number of in-flight requests with minimal overhead per request.
86
+ Falcon uses an asynchronous event-driven reactor to provide non-blocking IO. It can handle an arbitrary number of in-flight requests with minimal overhead per request.
85
87
 
86
88
  It uses one Fiber per request, which yields in the presence of blocking IO.
87
89
 
@@ -28,8 +28,10 @@ module Falcon
28
28
 
29
29
  # Wraps an array into a buffered body.
30
30
  def self.wrap(status, headers, body)
31
- # In no circumstance do we want this propagating up:
32
- content_length = headers.delete(CONTENT_LENGTH)
31
+ # In no circumstance do we want this header propagating out:
32
+ if content_length = headers.delete(CONTENT_LENGTH)
33
+ content_length = Integer(content_length)
34
+ end
33
35
 
34
36
  if body.is_a?(Async::HTTP::Body::Readable)
35
37
  return body
@@ -37,7 +39,7 @@ module Falcon
37
39
  # Don't mangle partial responsese (206)
38
40
  return Async::HTTP::Body::File.open(body.to_path)
39
41
  else
40
- return self.new(headers, body, (Integer(content_length) rescue nil))
42
+ return self.new(headers, body, content_length)
41
43
  end
42
44
  end
43
45
 
@@ -25,6 +25,7 @@ module Falcon
25
25
  def initialize
26
26
  @app = nil
27
27
  @endpoint = nil
28
+
28
29
  @ssl_certificate = nil
29
30
  @ssl_key = nil
30
31
 
@@ -37,6 +38,7 @@ module Falcon
37
38
 
38
39
  attr_accessor :ssl_certificate
39
40
  attr_accessor :ssl_key
41
+
40
42
  attr_accessor :ssl_context
41
43
 
42
44
  def freeze
@@ -56,7 +58,7 @@ module Falcon
56
58
  end
57
59
 
58
60
  def ssl_context
59
- @ssl_context ||= OpenSSL::SSL::SSLContext.new(:TLSv1).tap do |context|
61
+ @ssl_context ||= OpenSSL::SSL::SSLContext.new.tap do |context|
60
62
  context.cert = @ssl_certificate
61
63
  context.key = @ssl_key
62
64
 
@@ -64,7 +66,7 @@ module Falcon
64
66
 
65
67
  context.set_params
66
68
 
67
- context.freeze
69
+ context.setup
68
70
  end
69
71
  end
70
72
 
@@ -101,7 +103,7 @@ module Falcon
101
103
  end
102
104
 
103
105
  def ssl_context
104
- @server_context ||= OpenSSL::SSL::SSLContext.new(:TLSv1).tap do |context|
106
+ @server_context ||= OpenSSL::SSL::SSLContext.new.tap do |context|
105
107
  context.servername_cb = Proc.new do |socket, hostname|
106
108
  self.host_context(socket, hostname)
107
109
  end
@@ -112,7 +114,7 @@ module Falcon
112
114
 
113
115
  context.set_params
114
116
 
115
- context.freeze
117
+ context.setup
116
118
  end
117
119
  end
118
120
 
@@ -137,5 +139,9 @@ module Falcon
137
139
  @named.collect{|name, host| [name, host.endpoint]}
138
140
  ]
139
141
  end
142
+
143
+ def proxy
144
+ Proxy.new(Falcon::BadRequest, self.client_endpoints)
145
+ end
140
146
  end
141
147
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Falcon
22
- VERSION = "0.18.5"
22
+ VERSION = "0.18.6"
23
23
  end
data/server.rb CHANGED
@@ -36,7 +36,7 @@ hosts.each do |name, host|
36
36
  end
37
37
  end
38
38
 
39
- proxy = Falcon::Proxy.new(Falcon::BadRequest, hosts.client_endpoints)
39
+ proxy = hosts.proxy
40
40
  debug_trap = Async::IO::Trap.new(:USR1)
41
41
 
42
42
  profile = RubyProf::Profile.new(merge_fibers: true)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: falcon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.5
4
+ version: 0.18.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-12 00:00:00.000000000 Z
11
+ date: 2018-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-io