protocol-http1 0.16.1 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f969e504112849ed6eccb047bd8e240fc79dc92efd2835f8676469064fe2656c
4
- data.tar.gz: 25ffd9feeede23158051a130c5047f80a1f6f72b5c438e9adbc7fc1296add536
3
+ metadata.gz: '0521599a9879c2b6e81ff0a30b70f7279308513521d152e307e6d377b43f4718'
4
+ data.tar.gz: 5b33d64ddc8c51c3cb406df9cb51d0ac470c21d9e80dd62d1c3f9f05483206c5
5
5
  SHA512:
6
- metadata.gz: 0b40ee03ea89a7daf74e3e93a441b2ff2f1933657bb95440682d9eacf85487523a38a7fe1ef5aed251a2d784f0fd8b5cb87d674561a579b1f928ef104b7ef5d7
7
- data.tar.gz: 7063c346d1de2461b0ad5ee40aaa9b3992f0eb37f5930ba62869bc1b01df0d3c91b268e65a757bb98026b740036796a3e42a85add7bd7421a2e098bdd79a4fd0
6
+ metadata.gz: db5b2495e0d15100ec73b0b557b9ee31d38168e83a2aa077af5d4cea2df4861fd8dc79f9a92bfae14de2e7a36483c0ee35e085023d9f8ac1e6c5ded574698609
7
+ data.tar.gz: dbbefab8f69c35b4ee40e7e0951336e646569efbbd911d0296c3ff9d720d794c45d992d69572a26f56bcaafc8adbd291fff0defd053e1548cc65514bb7bf019b
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, 2019-2022, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
 
6
6
  require 'protocol/http/body/readable'
7
7
 
@@ -14,15 +14,17 @@ module Protocol
14
14
  # block_size may be removed in the future. It is better managed by stream.
15
15
  def initialize(stream)
16
16
  @stream = stream
17
+ @empty = false
17
18
  end
18
19
 
19
20
  def empty?
20
- @stream.eof? or @stream.closed?
21
+ @empty or @stream.closed?
21
22
  end
22
23
 
23
24
  def close(error = nil)
24
25
  # We can't really do anything in this case except close the connection.
25
26
  @stream.close
27
+ @empty = true
26
28
 
27
29
  super
28
30
  end
@@ -31,6 +33,8 @@ module Protocol
31
33
  def read
32
34
  @stream.readpartial(BLOCK_SIZE)
33
35
  rescue EOFError, IOError
36
+ @empty = true
37
+
34
38
  # I noticed that in some cases you will get EOFError, and in other cases IOError!?
35
39
  return nil
36
40
  end
@@ -45,6 +49,8 @@ module Protocol
45
49
 
46
50
  def join
47
51
  @stream.read
52
+ ensure
53
+ @empty = true
48
54
  end
49
55
 
50
56
  def inspect
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP1
8
- VERSION = "0.16.1"
8
+ VERSION = "0.18.0"
9
9
  end
10
10
  end
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2019-2023, by Samuel Williams.
3
+ Copyright, 2019-2024, by Samuel Williams.
4
4
  Copyright, 2019, by Brian Morearty.
5
5
  Copyright, 2020, by Olle Jonsson.
6
6
  Copyright, 2020, by Bruno Sutic.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.1
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -41,7 +41,7 @@ cert_chain:
41
41
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
42
42
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
43
43
  -----END CERTIFICATE-----
44
- date: 2023-12-26 00:00:00.000000000 Z
44
+ date: 2024-01-26 00:00:00.000000000 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: protocol-http
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubygems_version: 3.4.10
95
+ rubygems_version: 3.5.3
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: A low level implementation of the HTTP/1 protocol.
metadata.gz.sig CHANGED
Binary file