async-http 0.82.2 → 0.83.0
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/async/http/protocol/http1/client.rb +16 -0
- data/lib/async/http/protocol/http1/connection.rb +4 -3
- data/lib/async/http/protocol/http2/client.rb +24 -1
- data/lib/async/http/protocol/http2/connection.rb +2 -1
- data/lib/async/http/protocol/request.rb +2 -8
- data/lib/async/http/protocol/response.rb +2 -8
- data/lib/async/http/server.rb +0 -3
- data/lib/async/http/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +5 -5
- 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: 57a0e5c2719e47eb836ad8a9344c6c63b5eebf34940f3b38cb7b72e4772888ab
|
4
|
+
data.tar.gz: 13ca6cfaf3107f8257fbd8933507467a1c70b56dc0a4c0dce7593a2a663f95fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afe171debff45cafa3f1ae40fd39826f01a216b736216a54c1955c06bde4c9bcd79f2861e05b03b074990f080540c20457676486b7e3613cd9b572e9951ee840
|
7
|
+
data.tar.gz: b029f2c0e702b36fa8c246fcd3cb378a7a08b694677de222aba7701644a3110765e508ef28a528b16b8b53b922d8465a5079a3354b1249d7b32c273c00cdcf95
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -5,6 +5,8 @@
|
|
5
5
|
|
6
6
|
require_relative "connection"
|
7
7
|
|
8
|
+
require "traces/provider"
|
9
|
+
|
8
10
|
module Async
|
9
11
|
module HTTP
|
10
12
|
module Protocol
|
@@ -79,6 +81,20 @@ module Async
|
|
79
81
|
self.close(error)
|
80
82
|
raise
|
81
83
|
end
|
84
|
+
|
85
|
+
Traces::Provider(self) do
|
86
|
+
def write_request(...)
|
87
|
+
Traces.trace("async.http.protocol.http1.client.write_request") do
|
88
|
+
super
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def read_response(...)
|
93
|
+
Traces.trace("async.http.protocol.http1.client.read_response") do
|
94
|
+
super
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
82
98
|
end
|
83
99
|
end
|
84
100
|
end
|
@@ -3,11 +3,12 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2018-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require "protocol/http1"
|
7
|
-
|
8
6
|
require_relative "request"
|
9
7
|
require_relative "response"
|
10
8
|
|
9
|
+
require "protocol/http1"
|
10
|
+
require "protocol/http/peer"
|
11
|
+
|
11
12
|
module Async
|
12
13
|
module HTTP
|
13
14
|
module Protocol
|
@@ -42,7 +43,7 @@ module Async
|
|
42
43
|
end
|
43
44
|
|
44
45
|
def peer
|
45
|
-
@stream.io
|
46
|
+
@peer ||= Protocol::HTTP::Peer.for(@stream.io)
|
46
47
|
end
|
47
48
|
|
48
49
|
attr :count
|
@@ -6,6 +6,7 @@
|
|
6
6
|
require_relative "connection"
|
7
7
|
require_relative "response"
|
8
8
|
|
9
|
+
require "traces/provider"
|
9
10
|
require "protocol/http2/client"
|
10
11
|
|
11
12
|
module Async
|
@@ -34,10 +35,32 @@ module Async
|
|
34
35
|
@count += 1
|
35
36
|
|
36
37
|
response = create_response
|
38
|
+
write_request(response, request)
|
39
|
+
read_response(response)
|
40
|
+
|
41
|
+
return response
|
42
|
+
end
|
43
|
+
|
44
|
+
def write_request(response, request)
|
37
45
|
response.send_request(request)
|
46
|
+
end
|
47
|
+
|
48
|
+
def read_response(response)
|
38
49
|
response.wait
|
50
|
+
end
|
51
|
+
|
52
|
+
Traces::Provider(self) do
|
53
|
+
def write_request(...)
|
54
|
+
Traces.trace("async.http.protocol.http2.client.write_request") do
|
55
|
+
super
|
56
|
+
end
|
57
|
+
end
|
39
58
|
|
40
|
-
|
59
|
+
def read_response(...)
|
60
|
+
Traces.trace("async.http.protocol.http2.client.read_response") do
|
61
|
+
super
|
62
|
+
end
|
63
|
+
end
|
41
64
|
end
|
42
65
|
end
|
43
66
|
end
|
@@ -6,6 +6,7 @@
|
|
6
6
|
|
7
7
|
require_relative "stream"
|
8
8
|
|
9
|
+
require "protocol/http/peer"
|
9
10
|
require "async/semaphore"
|
10
11
|
|
11
12
|
module Async
|
@@ -112,7 +113,7 @@ module Async
|
|
112
113
|
attr :promises
|
113
114
|
|
114
115
|
def peer
|
115
|
-
@stream.io
|
116
|
+
@peer ||= Protocol::HTTP::Peer.for(@stream.io)
|
116
117
|
end
|
117
118
|
|
118
119
|
attr :count
|
@@ -29,17 +29,11 @@ module Async
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def peer
|
32
|
-
|
33
|
-
connection.peer
|
34
|
-
end
|
32
|
+
self.connection&.peer
|
35
33
|
end
|
36
34
|
|
37
35
|
def remote_address
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
def remote_address= value
|
42
|
-
@remote_address = value
|
36
|
+
self.peer&.address
|
43
37
|
end
|
44
38
|
|
45
39
|
def inspect
|
@@ -21,17 +21,11 @@ module Async
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def peer
|
24
|
-
|
25
|
-
connection.peer
|
26
|
-
end
|
24
|
+
self.connection&.peer
|
27
25
|
end
|
28
26
|
|
29
27
|
def remote_address
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
def remote_address= value
|
34
|
-
@remote_address = value
|
28
|
+
self.peer&.remote_address
|
35
29
|
end
|
36
30
|
|
37
31
|
def inspect
|
data/lib/async/http/server.rb
CHANGED
@@ -52,9 +52,6 @@ module Async
|
|
52
52
|
# https://tools.ietf.org/html/rfc7230#section-5.5
|
53
53
|
request.scheme ||= self.scheme
|
54
54
|
|
55
|
-
# This is a slight optimization to avoid having to get the address from the socket.
|
56
|
-
request.remote_address = address
|
57
|
-
|
58
55
|
# Console.logger.debug(self) {"Incoming request from #{address.inspect}: #{request.method} #{request.path}"}
|
59
56
|
|
60
57
|
# If this returns nil, we assume that the connection has been hijacked.
|
data/lib/async/http/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.83.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -58,7 +58,7 @@ cert_chain:
|
|
58
58
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
59
59
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
60
60
|
-----END CERTIFICATE-----
|
61
|
-
date: 2024-
|
61
|
+
date: 2024-11-09 00:00:00.000000000 Z
|
62
62
|
dependencies:
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: async
|
@@ -122,14 +122,14 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '0.
|
125
|
+
version: '0.43'
|
126
126
|
type: :runtime
|
127
127
|
prerelease: false
|
128
128
|
version_requirements: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: '0.
|
132
|
+
version: '0.43'
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
134
|
name: protocol-http1
|
135
135
|
requirement: !ruby/object:Gem::Requirement
|
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
259
259
|
- !ruby/object:Gem::Version
|
260
260
|
version: '0'
|
261
261
|
requirements: []
|
262
|
-
rubygems_version: 3.5.
|
262
|
+
rubygems_version: 3.5.22
|
263
263
|
signing_key:
|
264
264
|
specification_version: 4
|
265
265
|
summary: A HTTP client and server library.
|
metadata.gz.sig
CHANGED
Binary file
|