cool.io 1.4.5-x64-mingw32 → 1.7.1-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +4 -5
- data/CHANGES.md +52 -1
- data/Rakefile +1 -2
- data/cool.io.gemspec +3 -2
- data/ext/cool.io/cool.io.h +11 -0
- data/ext/cool.io/extconf.rb +8 -0
- data/ext/cool.io/iowatcher.c +6 -2
- data/ext/cool.io/loop.c +0 -1
- data/ext/cool.io/timer_watcher.c +1 -1
- data/ext/cool.io/utils.c +5 -0
- data/ext/iobuffer/extconf.rb +2 -2
- data/ext/libev/Changes +20 -14
- data/ext/libev/ev.c +275 -92
- data/ext/libev/ev.h +5 -4
- data/ext/libev/ev_epoll.c +8 -5
- data/ext/libev/ev_kqueue.c +8 -4
- data/ext/libev/ev_poll.c +6 -3
- data/ext/libev/ev_port.c +8 -4
- data/ext/libev/ev_select.c +4 -2
- data/ext/libev/ev_win32.c +2 -3
- data/lib/cool.io/dns_resolver.rb +9 -0
- data/lib/cool.io/socket.rb +3 -1
- data/lib/cool.io/version.rb +1 -1
- data/libev_ruby_gil.diff +175 -0
- data/{ext/libev/win_select.patch → libev_win_select.diff} +28 -13
- data/spec/dns_spec.rb +7 -0
- metadata +23 -20
- data/ext/libev/ruby_gil.patch +0 -97
data/spec/dns_spec.rb
CHANGED
@@ -19,6 +19,7 @@ end
|
|
19
19
|
describe "DNS" do
|
20
20
|
before :each do
|
21
21
|
@loop = Cool.io::Loop.new
|
22
|
+
@preferred_localhost_address = ::Socket.getaddrinfo("localhost", nil).first[3]
|
22
23
|
end
|
23
24
|
|
24
25
|
it "connects to valid domains" do
|
@@ -40,4 +41,10 @@ describe "DNS" do
|
|
40
41
|
@loop.run
|
41
42
|
end.to raise_error(WontResolve)
|
42
43
|
end
|
44
|
+
|
45
|
+
it "resolve localhost even though hosts is empty" do
|
46
|
+
Tempfile.open("empty") do |file|
|
47
|
+
expect( Coolio::DNSResolver.hosts("localhost", file.path)).to eq @preferred_localhost_address
|
48
|
+
end
|
49
|
+
end
|
43
50
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cool.io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Tony Arcieri
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-02-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0
|
20
|
+
version: '1.0'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0
|
27
|
+
version: '1.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake-compiler-dock
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0
|
34
|
+
version: '1.0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 0
|
41
|
+
version: '1.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,18 +121,16 @@ files:
|
|
121
121
|
- ext/libev/ev_vars.h
|
122
122
|
- ext/libev/ev_win32.c
|
123
123
|
- ext/libev/ev_wrap.h
|
124
|
-
- ext/libev/ruby_gil.patch
|
125
124
|
- ext/libev/test_libev_win32.c
|
126
|
-
- ext/libev/win_select.patch
|
127
125
|
- lib/.gitignore
|
128
|
-
- lib/2.
|
129
|
-
- lib/2.
|
130
|
-
- lib/2.
|
131
|
-
- lib/2.
|
132
|
-
- lib/2.
|
133
|
-
- lib/2.
|
134
|
-
- lib/2.
|
135
|
-
- lib/2.
|
126
|
+
- lib/2.4/cool.io_ext.so
|
127
|
+
- lib/2.4/iobuffer_ext.so
|
128
|
+
- lib/2.5/cool.io_ext.so
|
129
|
+
- lib/2.5/iobuffer_ext.so
|
130
|
+
- lib/2.6/cool.io_ext.so
|
131
|
+
- lib/2.6/iobuffer_ext.so
|
132
|
+
- lib/2.7/cool.io_ext.so
|
133
|
+
- lib/2.7/iobuffer_ext.so
|
136
134
|
- lib/cool.io.rb
|
137
135
|
- lib/cool.io/async_watcher.rb
|
138
136
|
- lib/cool.io/custom_require.rb
|
@@ -148,6 +146,8 @@ files:
|
|
148
146
|
- lib/cool.io/timer_watcher.rb
|
149
147
|
- lib/cool.io/version.rb
|
150
148
|
- lib/coolio.rb
|
149
|
+
- libev_ruby_gil.diff
|
150
|
+
- libev_win_select.diff
|
151
151
|
- spec/async_watcher_spec.rb
|
152
152
|
- spec/dns_spec.rb
|
153
153
|
- spec/iobuffer_spec.rb
|
@@ -160,7 +160,8 @@ files:
|
|
160
160
|
- spec/unix_listener_spec.rb
|
161
161
|
- spec/unix_server_spec.rb
|
162
162
|
homepage: http://coolio.github.com
|
163
|
-
licenses:
|
163
|
+
licenses:
|
164
|
+
- MIT
|
164
165
|
metadata: {}
|
165
166
|
post_install_message:
|
166
167
|
rdoc_options: []
|
@@ -170,15 +171,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
171
|
requirements:
|
171
172
|
- - ">="
|
172
173
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
174
|
+
version: '2.4'
|
175
|
+
- - "<"
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: 2.8.dev
|
174
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
179
|
requirements:
|
176
180
|
- - ">="
|
177
181
|
- !ruby/object:Gem::Version
|
178
182
|
version: '0'
|
179
183
|
requirements: []
|
180
|
-
|
181
|
-
rubygems_version: 2.5.1
|
184
|
+
rubygems_version: 3.1.2
|
182
185
|
signing_key:
|
183
186
|
specification_version: 4
|
184
187
|
summary: A cool framework for doing high performance I/O in Ruby
|
data/ext/libev/ruby_gil.patch
DELETED
@@ -1,97 +0,0 @@
|
|
1
|
-
diff --git a/ext/libev/ev.c b/ext/libev/ev.c
|
2
|
-
index e5bd5ab..10f6ff2 100644
|
3
|
-
--- a/ext/libev/ev.c
|
4
|
-
+++ b/ext/libev/ev.c
|
5
|
-
@@ -37,6 +37,10 @@
|
6
|
-
* either the BSD or the GPL.
|
7
|
-
*/
|
8
|
-
|
9
|
-
+/* ########## COOLIO PATCHERY HO! ########## */
|
10
|
-
+#include "ruby.h"
|
11
|
-
+/* ######################################## */
|
12
|
-
+
|
13
|
-
/* this big block deduces configuration from config.h */
|
14
|
-
#ifndef EV_STANDALONE
|
15
|
-
# ifdef EV_CONFIG_H
|
16
|
-
@@ -3237,9 +3241,27 @@ time_update (EV_P_ ev_tstamp max_block)
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
+/* ########## COOLIO PATCHERY HO! ########## */
|
21
|
-
+#if defined(HAVE_RB_THREAD_BLOCKING_REGION)
|
22
|
-
+static
|
23
|
-
+VALUE ev_backend_poll(void **args)
|
24
|
-
+{
|
25
|
-
+ struct ev_loop *loop = (struct ev_loop *)args[0];
|
26
|
-
+ ev_tstamp waittime = *(ev_tstamp *)args[1];
|
27
|
-
+ backend_poll (EV_A_ waittime);
|
28
|
-
+}
|
29
|
-
+#endif
|
30
|
-
+/* ######################################## */
|
31
|
-
+
|
32
|
-
int
|
33
|
-
ev_run (EV_P_ int flags)
|
34
|
-
{
|
35
|
-
+/* ########## COOLIO PATCHERY HO! ########## */
|
36
|
-
+#if defined(HAVE_RB_THREAD_BLOCKING_REGION)
|
37
|
-
+ void *poll_args[2];
|
38
|
-
+#endif
|
39
|
-
+/* ######################################## */
|
40
|
-
+
|
41
|
-
#if EV_FEATURE_API
|
42
|
-
++loop_depth;
|
43
|
-
#endif
|
44
|
-
@@ -3357,7 +3379,53 @@ ev_run (EV_P_ int flags)
|
45
|
-
++loop_count;
|
46
|
-
#endif
|
47
|
-
assert ((loop_done = EVBREAK_RECURSE, 1)); /* assert for side effect */
|
48
|
-
+
|
49
|
-
+/*
|
50
|
-
+########################## COOLIO PATCHERY HO! ##########################
|
51
|
-
+
|
52
|
-
+The original patch file is made by Tony Arcieri.
|
53
|
-
+https://github.com/celluloid/nio4r/blob/680143345726c5a64bb22376ca8fc3c6857019ae/ext/libev/ruby_gil.patch.
|
54
|
-
+
|
55
|
-
+According to the grandwizards of Ruby, locking and unlocking of the global
|
56
|
-
+interpreter lock are apparently too powerful a concept for a mere mortal to
|
57
|
-
+wield (although redefining what + and - do to numbers is totally cool).
|
58
|
-
+And so it came to pass that the only acceptable way to release the global
|
59
|
-
+interpreter lock is through a convoluted callback system that thakes a
|
60
|
-
+function pointer. While the grandwizard of libev foresaw this sort of scenario,
|
61
|
-
+he too attempted to place an API with callbacks on it, one that runs before
|
62
|
-
+the system call, and one that runs immediately after.
|
63
|
-
+
|
64
|
-
+And so it came to pass that trying to wrap everything up in callbacks created
|
65
|
-
+two incompatible APIs, Ruby's which releases the global interpreter lock and
|
66
|
-
+reacquires it when the callback returns, and libev's, which wants two
|
67
|
-
+callbacks, one which runs before the polling operation starts, and one which
|
68
|
-
+runs after it finishes.
|
69
|
-
+
|
70
|
-
+These two systems are incompatible as they both want to use callbacks to
|
71
|
-
+solve the same problem, however libev wants to use before/after callbacks,
|
72
|
-
+and Ruby wants to use an "around" callback. This presents a significant
|
73
|
-
+problem as these two patterns of callbacks are diametrical opposites of each
|
74
|
-
+other and thus cannot be composed.
|
75
|
-
+
|
76
|
-
+And thus we are left with no choice but to patch the internals of libev in
|
77
|
-
+order to release a mutex at just the precise moment.
|
78
|
-
+
|
79
|
-
+Let this be a lesson to the all: CALLBACKS FUCKING BLOW
|
80
|
-
+
|
81
|
-
+#######################################################################
|
82
|
-
+*/
|
83
|
-
+
|
84
|
-
+#if defined(HAVE_RB_THREAD_BLOCKING_REGION)
|
85
|
-
+ poll_args[0] = (void *)loop;
|
86
|
-
+ poll_args[1] = (void *)&waittime;
|
87
|
-
+ rb_thread_blocking_region(ev_backend_poll, (void *)&poll_args, RUBY_UBF_IO, 0);
|
88
|
-
+#else
|
89
|
-
backend_poll (EV_A_ waittime);
|
90
|
-
+#endif
|
91
|
-
+/*
|
92
|
-
+############################# END PATCHERY ############################
|
93
|
-
+*/
|
94
|
-
+
|
95
|
-
assert ((loop_done = EVBREAK_CANCEL, 1)); /* assert for side effect */
|
96
|
-
|
97
|
-
pipe_write_wanted = 0; /* just an optimisation, no fence needed */
|