falcon 0.28.1 → 0.28.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/falcon/adapters/hijack.rb +9 -15
- data/lib/falcon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ad38272a388a225bdf3ede24e5fd0bf33eb55b4efdce7e39b222ad29055bc56
|
4
|
+
data.tar.gz: c8f6c07c8c26ee73a0895a0ee35a9a0be879d848c570f06791221446c638699c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e70b7a5e24cc7fe8480141f1f8a695345898073570f26ab2a162762e65e42e74bf51d982ebec092f96a03676f0b9cdb83f5817fe054c18778088a430fe622acf
|
7
|
+
data.tar.gz: 3deee0be9e2d29c179f6fd0f1215c4227f8797b3ed9937eb30312e1dafc1eb3a2e6ca5bf35807ad72bcc5d6de96475a381e0600ba55767192aa85b0991c74aad
|
@@ -26,27 +26,25 @@ module Falcon
|
|
26
26
|
# This is used for implementing partial hijack.
|
27
27
|
class Hijack
|
28
28
|
def self.for(env, block, socket = nil, task: Async::Task.current)
|
29
|
-
input = env[Rack::RACK_INPUT]
|
29
|
+
input = socket || env[Rack::RACK_INPUT]
|
30
30
|
output = Async::HTTP::Body::Writable.new
|
31
31
|
|
32
|
-
stream = Hijack.new(input, output
|
32
|
+
stream = Hijack.new(input, output)
|
33
33
|
|
34
34
|
task.async do
|
35
35
|
begin
|
36
36
|
block.call(stream)
|
37
37
|
ensure
|
38
|
-
|
38
|
+
output.close
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
return output
|
43
43
|
end
|
44
44
|
|
45
|
-
def initialize(input, output
|
45
|
+
def initialize(input, output)
|
46
46
|
@input = input
|
47
47
|
@output = output
|
48
|
-
@socket = socket
|
49
|
-
@closed = false
|
50
48
|
end
|
51
49
|
|
52
50
|
def read(length = nil, buffer = nil)
|
@@ -67,24 +65,20 @@ module Falcon
|
|
67
65
|
end
|
68
66
|
|
69
67
|
def close
|
70
|
-
return if @closed
|
71
|
-
|
72
|
-
@input.close
|
73
68
|
@output.close
|
74
|
-
@closed = true
|
75
69
|
end
|
76
70
|
|
77
71
|
def close_read
|
78
|
-
@input.
|
72
|
+
if @input.respond_to?(:close_read)
|
73
|
+
@input.close_read
|
74
|
+
else
|
75
|
+
@input.close
|
76
|
+
end
|
79
77
|
end
|
80
78
|
|
81
79
|
def close_write
|
82
80
|
@output.close
|
83
81
|
end
|
84
|
-
|
85
|
-
def closed?
|
86
|
-
@closed
|
87
|
-
end
|
88
82
|
end
|
89
83
|
end
|
90
84
|
end
|
data/lib/falcon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: falcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.28.
|
4
|
+
version: 0.28.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -322,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
322
322
|
- !ruby/object:Gem::Version
|
323
323
|
version: '0'
|
324
324
|
requirements: []
|
325
|
-
rubygems_version: 3.0.
|
325
|
+
rubygems_version: 3.0.3
|
326
326
|
signing_key:
|
327
327
|
specification_version: 4
|
328
328
|
summary: A fast, asynchronous, rack-compatible web server.
|