async-http 0.79.0 → 0.80.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93d3d9d22a84537ba522b417586a7bc02d243d56defe26fb9a3937470675b244
4
- data.tar.gz: 8c16add5b2c301948235c739d076f92c400cdd745cc36881fac49125a41c5bc4
3
+ metadata.gz: 6563a3eb6c06ca33e6038985b9f4e4608355f8179d010b009f37ae33bb5db906
4
+ data.tar.gz: ca7d4e2483b0a9c9e277fbbca2741de22e351240b5498317f8373b05c7d6ab3c
5
5
  SHA512:
6
- metadata.gz: cf362c7394967d2746e6d37984f25f5fc02e8e1fa89b7d5f6afcf31d87e665d75877cd5a9cd920f1ae87b6ecbc73e7d9b7cedc72467a69d95b5d24a04b897a8e
7
- data.tar.gz: e922cf9cfd745423d9350f633d1a152dd8f6e06ae23abd3c8b1e403f49abb7089181aa68a1ded1a329cf2017b7bf98feb6a60fed45e1f8582eb3b01ca401ce4d
6
+ metadata.gz: f9f2673c93c361ba9afa178c9a7742aeb2848e44ccec6a483a06694655c9a37364ccd76218f76e111522b8d951ccbe89dee8a32f14a685f134cedaf108e33921
7
+ data.tar.gz: d273737eb122e13aa9464420bde93a57488e608d41f2c4006f44e9083b6057a20a3904af0db07fa2ab9b564afdceeb40d30823bc6dd9b70460d6a88644a053b3
checksums.yaml.gz.sig CHANGED
Binary file
@@ -14,6 +14,11 @@ require "io/endpoint/ssl_endpoint"
14
14
  require_relative "protocol/http"
15
15
  require_relative "protocol/https"
16
16
 
17
+ require "uri"
18
+
19
+ # Compatibility with Ruby 3.1.2
20
+ require "uri/wss"
21
+
17
22
  module Async
18
23
  module HTTP
19
24
  # Represents a way to connect to a remote HTTP server.
@@ -43,7 +43,8 @@ module Async
43
43
 
44
44
  def read_line?
45
45
  @stream.read_until(CRLF)
46
- rescue Errno::ECONNRESET
46
+ rescue => error
47
+ # Bascially, any error will cause the connection to be closed:
47
48
  return nil
48
49
  end
49
50
 
@@ -17,7 +17,8 @@ module Async
17
17
 
18
18
  @task = nil
19
19
 
20
- @window_updated = Async::Condition.new
20
+ @guard = ::Mutex.new
21
+ @window_updated = ::ConditionVariable.new
21
22
  end
22
23
 
23
24
  attr :trailer
@@ -33,17 +34,26 @@ module Async
33
34
  end
34
35
 
35
36
  def window_updated(size)
36
- @window_updated.signal
37
+ @guard.synchronize do
38
+ @window_updated.signal
39
+ end
37
40
  end
38
41
 
39
42
  def write(chunk)
40
43
  until chunk.empty?
41
44
  maximum_size = @stream.available_frame_size
42
45
 
43
- while maximum_size <= 0
44
- @window_updated.wait
45
-
46
- maximum_size = @stream.available_frame_size
46
+ # We try to avoid synchronization if possible:
47
+ if maximum_size <= 0
48
+ @guard.synchronize do
49
+ maximum_size = @stream.available_frame_size
50
+
51
+ while maximum_size <= 0
52
+ @window_updated.wait(@guard)
53
+
54
+ maximum_size = @stream.available_frame_size
55
+ end
56
+ end
47
57
  end
48
58
 
49
59
  break unless chunk = send_data(chunk, maximum_size)
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module HTTP
8
- VERSION = "0.79.0"
8
+ VERSION = "0.80.1"
9
9
  end
10
10
  end
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.79.0
4
+ version: 0.80.1
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-09-24 00:00:00.000000000 Z
61
+ date: 2024-10-12 00:00:00.000000000 Z
62
62
  dependencies:
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: async
metadata.gz.sig CHANGED
Binary file