h1p 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/ext/h1p/h1p.c +5 -5
- data/lib/h1p/version.rb +1 -1
- data/lib/h1p.rb +4 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a27a3323482c8a0cec845e60962516b755338ccc54d0ba76bf6716bbb449a8ff
|
4
|
+
data.tar.gz: 22613ade68e261e3fca56cafcab410b1bed4587efe8c1da4ef52d1d335bc7efd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36cb9020745437627ad3dca5f83de6f81f8ad6e04075909db192a509b9f022960c5a7768c1f1ab8fdb807ae0d7b54e6febbc76581e68475c5f27057ff5b7aeb5
|
7
|
+
data.tar.gz: 20943cfead5e0236e60cb3a0d70057c69a91bbde45973f0f4ff87f38a1866523c1a02132254eebc13b8c5e2c4f75cd8e5791246257a792f63391cff88a6e1011
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -166,7 +166,7 @@ expected (based on the received headers).
|
|
166
166
|
The H1P parser was built to read from any arbitrary transport or source, as long
|
167
167
|
as they conform to one of two alternative interfaces:
|
168
168
|
|
169
|
-
- An object implementing a `
|
169
|
+
- An object implementing a `__read_method__` method, which returns any of
|
170
170
|
the following values:
|
171
171
|
|
172
172
|
- `:stock_readpartial` - to be used for instances of `IO`, `Socket`,
|
data/ext/h1p/h1p.c
CHANGED
@@ -20,7 +20,7 @@ ID ID_call;
|
|
20
20
|
ID ID_downcase;
|
21
21
|
ID ID_eof_p;
|
22
22
|
ID ID_eq;
|
23
|
-
ID
|
23
|
+
ID ID_read_method;
|
24
24
|
ID ID_read;
|
25
25
|
ID ID_readpartial;
|
26
26
|
ID ID_to_i;
|
@@ -123,8 +123,8 @@ static inline void get_polyphony() {
|
|
123
123
|
}
|
124
124
|
|
125
125
|
enum read_method detect_read_method(VALUE io) {
|
126
|
-
if (rb_respond_to(io,
|
127
|
-
VALUE method = rb_funcall(io,
|
126
|
+
if (rb_respond_to(io, ID_read_method)) {
|
127
|
+
VALUE method = rb_funcall(io, ID_read_method, 0);
|
128
128
|
if (method == SYM_stock_readpartial) return method_stock_readpartial;
|
129
129
|
|
130
130
|
get_polyphony();
|
@@ -137,7 +137,7 @@ enum read_method detect_read_method(VALUE io) {
|
|
137
137
|
return method_call;
|
138
138
|
}
|
139
139
|
else
|
140
|
-
rb_raise(rb_eRuntimeError, "Provided reader should be a callable or respond to #
|
140
|
+
rb_raise(rb_eRuntimeError, "Provided reader should be a callable or respond to #__read_method__");
|
141
141
|
}
|
142
142
|
|
143
143
|
enum parser_mode parse_parser_mode(VALUE mode) {
|
@@ -978,7 +978,7 @@ void Init_H1P() {
|
|
978
978
|
ID_downcase = rb_intern("downcase");
|
979
979
|
ID_eof_p = rb_intern("eof?");
|
980
980
|
ID_eq = rb_intern("==");
|
981
|
-
|
981
|
+
ID_read_method = rb_intern("__read_method__");
|
982
982
|
ID_read = rb_intern("read");
|
983
983
|
ID_readpartial = rb_intern("readpartial");
|
984
984
|
ID_to_i = rb_intern("to_i");
|
data/lib/h1p/version.rb
CHANGED
data/lib/h1p.rb
CHANGED
@@ -4,7 +4,7 @@ require_relative './h1p_ext'
|
|
4
4
|
|
5
5
|
unless Object.const_defined?('Polyphony')
|
6
6
|
class IO
|
7
|
-
def
|
7
|
+
def __read_method__
|
8
8
|
:stock_readpartial
|
9
9
|
end
|
10
10
|
end
|
@@ -12,19 +12,19 @@ unless Object.const_defined?('Polyphony')
|
|
12
12
|
require 'socket'
|
13
13
|
|
14
14
|
class Socket
|
15
|
-
def
|
15
|
+
def __read_method__
|
16
16
|
:stock_readpartial
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
class TCPSocket
|
21
|
-
def
|
21
|
+
def __read_method__
|
22
22
|
:stock_readpartial
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
class UNIXSocket
|
27
|
-
def
|
27
|
+
def __read_method__
|
28
28
|
:stock_readpartial
|
29
29
|
end
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: h1p
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 5.14.4
|
55
|
-
description:
|
55
|
+
description:
|
56
56
|
email: sharon@noteflakes.com
|
57
57
|
executables: []
|
58
58
|
extensions:
|
@@ -89,7 +89,7 @@ licenses:
|
|
89
89
|
- MIT
|
90
90
|
metadata:
|
91
91
|
source_code_uri: https://github.com/digital-fabric/h1p
|
92
|
-
post_install_message:
|
92
|
+
post_install_message:
|
93
93
|
rdoc_options:
|
94
94
|
- "--title"
|
95
95
|
- h1p
|
@@ -108,8 +108,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
rubygems_version: 3.
|
112
|
-
signing_key:
|
111
|
+
rubygems_version: 3.1.6
|
112
|
+
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: H1P is a blocking HTTP/1 parser for Ruby
|
115
115
|
test_files: []
|