falcon 0.39.1 → 0.40.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/falcon/adapters/output.rb +1 -1
- data/lib/falcon/extensions/openssl.rb +9 -7
- data/lib/falcon/services.rb +2 -2
- data/lib/falcon/version.rb +1 -1
- data/lib/rack/handler/falcon.rb +48 -13
- data.tar.gz.sig +0 -0
- metadata +53 -8
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94f85c9e2ed95f6a43fda46cc07a986436ec7d874294b28288bcb004d269ea3c
|
4
|
+
data.tar.gz: f56850aab821d12cd73cdc1545ad2691bce81d1121ae543feb3d29f6e8ae28da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 047ac6d846d54362c8cc220f0264c60f9c951c557a61ca9c34636a93198acf04ab1b6e0b7ff10a684a8700f4b6a158dd57abf453cfa71bd5e9dee949eeedccdf
|
7
|
+
data.tar.gz: 425b8131c9cbbe18684492213351e480a42d8037fc198c234ce7cd19e5f3f61b5bf59145b8335e8508928ee766ddcbff8992925084c2f5dbd5cfe1f0207de03b
|
checksums.yaml.gz.sig
ADDED
Binary file
|
@@ -22,13 +22,15 @@
|
|
22
22
|
|
23
23
|
require 'openssl/x509'
|
24
24
|
|
25
|
-
module OpenSSL
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
module OpenSSL
|
26
|
+
module X509
|
27
|
+
CERTIFICATE_PATTERN = /-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----/m
|
28
|
+
|
29
|
+
# An extension to load an array of certificates from a file at the given path.
|
30
|
+
def self.load_certificates(path)
|
31
|
+
File.read(path).scan(CERTIFICATE_PATTERN).collect do |text|
|
32
|
+
Certificate.new(text)
|
33
|
+
end
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
data/lib/falcon/services.rb
CHANGED
data/lib/falcon/version.rb
CHANGED
data/lib/rack/handler/falcon.rb
CHANGED
@@ -4,16 +4,16 @@ require 'rack/handler'
|
|
4
4
|
|
5
5
|
require_relative '../../falcon'
|
6
6
|
|
7
|
-
require '
|
7
|
+
require 'kernel/sync'
|
8
8
|
require 'async/io/host_endpoint'
|
9
|
+
require 'async/io/notification'
|
9
10
|
|
10
11
|
module Rack
|
11
12
|
module Handler
|
12
13
|
# The falcon adaptor for the `rackup` executable.
|
13
|
-
|
14
|
+
class Falcon
|
14
15
|
# The default scheme.
|
15
16
|
SCHEME = "http"
|
16
|
-
NAME = :falcon
|
17
17
|
|
18
18
|
# Generate an endpoint for the given `rackup` options.
|
19
19
|
# @returns [Async::IO::Endpoint]
|
@@ -27,20 +27,55 @@ module Rack
|
|
27
27
|
# Run the specified app using the given options:
|
28
28
|
# @parameter app [Object] The rack middleware.
|
29
29
|
def self.run(app, **options)
|
30
|
-
endpoint = endpoint_for(**options)
|
31
|
-
|
32
30
|
app = ::Falcon::Adapters::Rack.new(app)
|
33
31
|
app = ::Falcon::Adapters::Rewindable.new(app)
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
|
33
|
+
Sync do |task|
|
34
|
+
endpoint = endpoint_for(**options)
|
35
|
+
server = ::Falcon::Server.new(app, endpoint, protocol: Async::HTTP::Protocol::HTTP1, scheme: SCHEME)
|
36
|
+
|
37
|
+
server_task = task.async do
|
38
|
+
server.run.each(&:wait)
|
39
|
+
end
|
40
|
+
|
41
|
+
wrapper = self.new(server, task)
|
42
|
+
|
43
|
+
yield wrapper if block_given?
|
44
|
+
|
45
|
+
server_task.wait
|
46
|
+
ensure
|
47
|
+
server_task.stop
|
48
|
+
wrapper.close
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def initialize(server, task)
|
53
|
+
@server = server
|
54
|
+
@task = task
|
55
|
+
|
56
|
+
@notification = Async::IO::Notification.new
|
57
|
+
|
58
|
+
@waiter = @task.async(transient: true) do
|
59
|
+
@notification.wait
|
60
|
+
|
61
|
+
@task&.stop
|
62
|
+
@task = nil
|
40
63
|
end
|
41
64
|
end
|
65
|
+
|
66
|
+
def stop
|
67
|
+
@notification&.signal
|
68
|
+
end
|
69
|
+
|
70
|
+
def close
|
71
|
+
@notification&.close
|
72
|
+
@notification = nil
|
73
|
+
|
74
|
+
@waiter&.stop
|
75
|
+
@waiter = nil
|
76
|
+
end
|
42
77
|
end
|
43
|
-
|
44
|
-
register
|
78
|
+
|
79
|
+
register :falcon, Falcon
|
45
80
|
end
|
46
81
|
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
CHANGED
@@ -1,29 +1,74 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: falcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.40.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
|
+
- Janko Marohnić
|
9
|
+
- dependabot[bot]
|
10
|
+
- Bryan Powell
|
11
|
+
- Sho Ito
|
12
|
+
- claudiu
|
13
|
+
- takkanm
|
14
|
+
- tamkylet
|
15
|
+
- Colby Swandale
|
16
|
+
- Daniel Evans
|
17
|
+
- Kent Gruber
|
18
|
+
- Michael Adams
|
19
|
+
- Mikel Kew
|
20
|
+
- Olle Jonsson
|
21
|
+
- Sh Lin
|
22
|
+
- Tad Thorley
|
23
|
+
- Tasos Latsas
|
24
|
+
- deepj
|
8
25
|
autorequire:
|
9
26
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
|
27
|
+
cert_chain:
|
28
|
+
- |
|
29
|
+
-----BEGIN CERTIFICATE-----
|
30
|
+
MIIEhDCCAuygAwIBAgIBATANBgkqhkiG9w0BAQsFADA3MTUwMwYDVQQDDCxzYW11
|
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LmNvLm56MA0GCSqGSIb3DQEB
|
46
|
+
CwUAA4IBgQBVoM+pu3dpdUhZM1w051iw5GfiqclAr1Psypf16Tiod/ho//4oAu6T
|
47
|
+
9fj3DPX/acWV9P/FScvqo4Qgv6g4VWO5ZU7z2JmPoTXZtYMunRAmQPFL/gSUc6aK
|
48
|
+
vszMHIyhtyzRc6DnfW2AiVOjMBjaYv8xXZc9bduniRVPrLR4J7ozmGLh4o4uJp7w
|
49
|
+
x9KCFaR8Lvn/r0oJWJOqb/DMAYI83YeN2Dlt3jpwrsmsONrtC5S3gOUle5afSGos
|
50
|
+
bYt5ocnEpKSomR9ZtnCGljds/aeO1Xgpn2r9HHcjwnH346iNrnHmMlC7BtHUFPDg
|
51
|
+
Ts92S47PTOXzwPBDsrFiq3VLbRjHSwf8rpqybQBH9MfzxGGxTaETQYOd6b4e4Ag6
|
52
|
+
y92abGna0bmIEb4+Tx9rQ10Uijh1POzvr/VTH4bbIPy9FbKrRsIQ24qDbNJRtOpE
|
53
|
+
RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
|
54
|
+
HiLJ8VOFx6w=
|
55
|
+
-----END CERTIFICATE-----
|
56
|
+
date: 2022-07-19 00:00:00.000000000 Z
|
12
57
|
dependencies:
|
13
58
|
- !ruby/object:Gem::Dependency
|
14
59
|
name: async
|
15
60
|
requirement: !ruby/object:Gem::Requirement
|
16
61
|
requirements:
|
17
|
-
- - "
|
62
|
+
- - ">="
|
18
63
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
64
|
+
version: '0'
|
20
65
|
type: :runtime
|
21
66
|
prerelease: false
|
22
67
|
version_requirements: !ruby/object:Gem::Requirement
|
23
68
|
requirements:
|
24
|
-
- - "
|
69
|
+
- - ">="
|
25
70
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
71
|
+
version: '0'
|
27
72
|
- !ruby/object:Gem::Dependency
|
28
73
|
name: async-container
|
29
74
|
requirement: !ruby/object:Gem::Requirement
|
@@ -322,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
322
367
|
- !ruby/object:Gem::Version
|
323
368
|
version: '0'
|
324
369
|
requirements: []
|
325
|
-
rubygems_version: 3.
|
370
|
+
rubygems_version: 3.3.7
|
326
371
|
signing_key:
|
327
372
|
specification_version: 4
|
328
373
|
summary: A fast, asynchronous, rack-compatible web server.
|
metadata.gz.sig
ADDED
Binary file
|