async-http 0.98.0 → 0.98.1
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/http/protocol/http1/connection.rb +19 -2
- data/lib/async/http/version.rb +1 -1
- data/readme.md +4 -4
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +3 -3
- 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: 32a7056790328efb71a89aa3c721672b18640bef1ac9c6ba67ce934f085f3c64
|
|
4
|
+
data.tar.gz: df9f6b4843347757a887d9ab64e49af66e2e88cfc6dcc8659d77dc875f0d02b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 040b5ef80794ddda14b86cdfcb118fd63de4ee72c21c8923e740b2ad3cfb7138370edf87c0db5249b6e177009ba4c7683cc6ab8515e3f94720ab74462839e669
|
|
7
|
+
data.tar.gz: 2f5f60d796f3fd4d1dcad6f8dfd9acd11ed40c82a3092f65cdf22093e9c2019a558cb91085978a76a78be78596207bebfa7a2554fd8eac0c2503f268829cd999
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2018-
|
|
4
|
+
# Copyright, 2018-2026, by Samuel Williams.
|
|
5
5
|
|
|
6
6
|
require_relative "request"
|
|
7
7
|
require_relative "response"
|
|
@@ -67,7 +67,24 @@ module Async
|
|
|
67
67
|
|
|
68
68
|
# Can we use this connection to make requests?
|
|
69
69
|
def viable?
|
|
70
|
-
self.idle?
|
|
70
|
+
unless self.idle?
|
|
71
|
+
return false
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
unless @stream
|
|
75
|
+
return false
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# `nil` indicates that the connection has no data, but is still alive. An empty string means the connection is closed, while a non-empty string indicates application data on a idle HTTP/1 connection, both are failure cases.
|
|
79
|
+
if @stream.peek_partial(1)
|
|
80
|
+
return false
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
return @stream.readable?
|
|
84
|
+
rescue => error
|
|
85
|
+
Console.debug(self, "Connection viability probe failed!", exception: error)
|
|
86
|
+
|
|
87
|
+
return false
|
|
71
88
|
end
|
|
72
89
|
|
|
73
90
|
# @returns [Boolean] Whether the connection can be reused for another request.
|
data/lib/async/http/version.rb
CHANGED
data/readme.md
CHANGED
|
@@ -16,6 +16,10 @@ Please see the [project documentation](https://socketry.github.io/async-http/) f
|
|
|
16
16
|
|
|
17
17
|
Please see the [project releases](https://socketry.github.io/async-http/releases/index) for all releases.
|
|
18
18
|
|
|
19
|
+
### v0.98.1
|
|
20
|
+
|
|
21
|
+
- Probe idle HTTP/1 connections before reuse, avoiding requests on connections already closed by the peer.
|
|
22
|
+
|
|
19
23
|
### v0.98.0
|
|
20
24
|
|
|
21
25
|
- Rewind request bodies before retrying requests.
|
|
@@ -55,10 +59,6 @@ Please see the [project releases](https://socketry.github.io/async-http/releases
|
|
|
55
59
|
|
|
56
60
|
- Better handling of trailers. If invalid trailers are received, the connection (HTTP/1) or stream (HTTP/2) is reset.
|
|
57
61
|
|
|
58
|
-
### v0.92.0
|
|
59
|
-
|
|
60
|
-
- **Breaking**: Remove `Async::HTTP::Reference`. Use `Protocol::URL::Reference` directly instead.
|
|
61
|
-
|
|
62
62
|
## See Also
|
|
63
63
|
|
|
64
64
|
- [benchmark-http](https://github.com/socketry/benchmark-http) — A benchmarking tool to report on web server concurrency.
|
data/releases.md
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.98.
|
|
4
|
+
version: 0.98.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
@@ -110,14 +110,14 @@ dependencies:
|
|
|
110
110
|
requirements:
|
|
111
111
|
- - "~>"
|
|
112
112
|
- !ruby/object:Gem::Version
|
|
113
|
-
version: '0.
|
|
113
|
+
version: '0.14'
|
|
114
114
|
type: :runtime
|
|
115
115
|
prerelease: false
|
|
116
116
|
version_requirements: !ruby/object:Gem::Requirement
|
|
117
117
|
requirements:
|
|
118
118
|
- - "~>"
|
|
119
119
|
- !ruby/object:Gem::Version
|
|
120
|
-
version: '0.
|
|
120
|
+
version: '0.14'
|
|
121
121
|
- !ruby/object:Gem::Dependency
|
|
122
122
|
name: protocol-http
|
|
123
123
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
|
Binary file
|