cool.io 1.4.1-x86-mingw32 → 1.4.4-x86-mingw32
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
- data/.travis.yml +4 -0
- data/CHANGES.md +16 -0
- data/Rakefile +1 -1
- data/appveyor.yml +18 -0
- data/cool.io.gemspec +2 -7
- data/ext/cool.io/extconf.rb +5 -0
- data/ext/cool.io/loop.c +1 -8
- data/ext/cool.io/stat_watcher.c +2 -2
- data/ext/cool.io/timer_watcher.c +2 -2
- data/ext/cool.io/watcher.h +1 -1
- data/lib/cool.io/dns_resolver.rb +1 -1
- data/lib/cool.io/listener.rb +25 -13
- data/lib/cool.io/meta.rb +1 -0
- data/lib/cool.io/socket.rb +1 -0
- data/lib/cool.io/version.rb +1 -1
- data/spec/stat_watcher_spec.rb +5 -1
- data/spec/tcp_server_spec.rb +2 -2
- data/spec/unix_listener_spec.rb +1 -1
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5d948e37a0e1e67a5cc3c5ea1ce245978b49d53
|
4
|
+
data.tar.gz: b2e5066e7e85a8e3953fec44e48cbfb95475a85b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa5d5fa45b27b83b1a6a208c18564313115bd92e3dfd0b6a6fe20bac25ee35e8f57ddc47d0d68c242cecbf7a5c5a167350a613133df3c69966c23553172dd758
|
7
|
+
data.tar.gz: 8d5ac92a7adad338669cffcb4c9d02c2e70cf4e85f167ad5fbc8f248086176f1af7a30130c5d7f03b51fdecf2683eef3d10ee802a443f599d9049f4e27458508
|
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
1.4.4
|
2
|
+
-----
|
3
|
+
|
4
|
+
* Suppress lots of warnings
|
5
|
+
|
6
|
+
1.4.3
|
7
|
+
-----
|
8
|
+
|
9
|
+
* Use accept instead of accept_nonblock on Windows to avoid thundering held problem
|
10
|
+
* Fix compilation error on Solaris and Ruby 2.3.0
|
11
|
+
|
12
|
+
1.4.2
|
13
|
+
-----
|
14
|
+
|
15
|
+
* Add unexpected object info to attach exception message
|
16
|
+
|
1
17
|
1.4.1
|
2
18
|
-----
|
3
19
|
|
data/Rakefile
CHANGED
data/appveyor.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
install:
|
3
|
+
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
4
|
+
- ruby --version
|
5
|
+
- gem --version
|
6
|
+
- bundle install
|
7
|
+
build: off
|
8
|
+
test_script:
|
9
|
+
- bundle exec rake -rdevkit
|
10
|
+
|
11
|
+
environment:
|
12
|
+
matrix:
|
13
|
+
- ruby_version: "200"
|
14
|
+
- ruby_version: "200-x64"
|
15
|
+
- ruby_version: "21"
|
16
|
+
- ruby_version: "21-x64"
|
17
|
+
- ruby_version: "22"
|
18
|
+
- ruby_version: "22-x64"
|
data/cool.io.gemspec
CHANGED
@@ -2,11 +2,6 @@
|
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
3
|
require "cool.io/version"
|
4
4
|
|
5
|
-
module Cool
|
6
|
-
# Allow Coolio module to be referenced as Cool.io
|
7
|
-
def self.io; Coolio; end
|
8
|
-
end
|
9
|
-
|
10
5
|
Gem::Specification.new do |s|
|
11
6
|
s.name = "cool.io"
|
12
7
|
s.version = Coolio::VERSION
|
@@ -21,9 +16,9 @@ Gem::Specification.new do |s|
|
|
21
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
22
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
18
|
s.require_paths = ["lib"]
|
24
|
-
|
19
|
+
|
25
20
|
s.add_development_dependency "rake-compiler", "~> 0.9.5"
|
26
|
-
s.add_development_dependency "rake-compiler-dock", "~> 0.
|
21
|
+
s.add_development_dependency "rake-compiler-dock", "~> 0.5.1"
|
27
22
|
s.add_development_dependency "rspec", ">= 2.13.0"
|
28
23
|
s.add_development_dependency "rdoc", ">= 3.6.0"
|
29
24
|
end
|
data/ext/cool.io/extconf.rb
CHANGED
data/ext/cool.io/loop.c
CHANGED
@@ -18,7 +18,6 @@ static VALUE Coolio_Loop_allocate(VALUE klass);
|
|
18
18
|
static void Coolio_Loop_mark(struct Coolio_Loop *loop);
|
19
19
|
static void Coolio_Loop_free(struct Coolio_Loop *loop);
|
20
20
|
|
21
|
-
static VALUE Coolio_Loop_initialize(VALUE self);
|
22
21
|
static VALUE Coolio_Loop_ev_loop_new(VALUE self, VALUE flags);
|
23
22
|
static VALUE Coolio_Loop_run_once(int argc, VALUE *argv, VALUE self);
|
24
23
|
static VALUE Coolio_Loop_run_nonblock(VALUE self);
|
@@ -43,8 +42,7 @@ void Init_coolio_loop()
|
|
43
42
|
mCoolio = rb_define_module("Coolio");
|
44
43
|
cCoolio_Loop = rb_define_class_under(mCoolio, "Loop", rb_cObject);
|
45
44
|
rb_define_alloc_func(cCoolio_Loop, Coolio_Loop_allocate);
|
46
|
-
|
47
|
-
rb_define_method(cCoolio_Loop, "initialize", Coolio_Loop_initialize, 0);
|
45
|
+
|
48
46
|
rb_define_private_method(cCoolio_Loop, "ev_loop_new", Coolio_Loop_ev_loop_new, 1);
|
49
47
|
rb_define_method(cCoolio_Loop, "run_once", Coolio_Loop_run_once, -1);
|
50
48
|
rb_define_method(cCoolio_Loop, "run_nonblock", Coolio_Loop_run_nonblock, 0);
|
@@ -79,11 +77,6 @@ static void Coolio_Loop_free(struct Coolio_Loop *loop)
|
|
79
77
|
xfree(loop);
|
80
78
|
}
|
81
79
|
|
82
|
-
static VALUE Coolio_Loop_initialize(VALUE self)
|
83
|
-
{
|
84
|
-
return Coolio_Loop_ev_loop_new(self, INT2NUM(0));
|
85
|
-
}
|
86
|
-
|
87
80
|
/* Wrapper for populating a Coolio_Loop struct with a new event loop */
|
88
81
|
static VALUE Coolio_Loop_ev_loop_new(VALUE self, VALUE flags)
|
89
82
|
{
|
data/ext/cool.io/stat_watcher.c
CHANGED
@@ -116,8 +116,8 @@ static VALUE Coolio_StatWatcher_attach(VALUE self, VALUE loop)
|
|
116
116
|
struct Coolio_Loop *loop_data;
|
117
117
|
struct Coolio_Watcher *watcher_data;
|
118
118
|
|
119
|
-
|
120
|
-
|
119
|
+
if(!rb_obj_is_kind_of(loop, cCoolio_Loop))
|
120
|
+
rb_raise(rb_eArgError, "expected loop to be an instance of Coolio::Loop, not %s", RSTRING_PTR(rb_inspect(loop)));
|
121
121
|
|
122
122
|
Data_Get_Struct(loop, struct Coolio_Loop, loop_data);
|
123
123
|
Data_Get_Struct(self, struct Coolio_Watcher, watcher_data);
|
data/ext/cool.io/timer_watcher.c
CHANGED
@@ -95,8 +95,8 @@ static VALUE Coolio_TimerWatcher_attach(VALUE self, VALUE loop)
|
|
95
95
|
struct Coolio_Loop *loop_data;
|
96
96
|
struct Coolio_Watcher *watcher_data;
|
97
97
|
|
98
|
-
|
99
|
-
|
98
|
+
if(!rb_obj_is_kind_of(loop, cCoolio_Loop))
|
99
|
+
rb_raise(rb_eArgError, "expected loop to be an instance of Coolio::Loop, not %s", RSTRING_PTR(rb_inspect(loop)));
|
100
100
|
|
101
101
|
Data_Get_Struct(loop, struct Coolio_Loop, loop_data);
|
102
102
|
Data_Get_Struct(self, struct Coolio_Watcher, watcher_data);
|
data/ext/cool.io/watcher.h
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
struct Coolio_Loop *loop_data; \
|
13
13
|
\
|
14
14
|
if(!rb_obj_is_kind_of(loop, cCoolio_Loop)) \
|
15
|
-
rb_raise(rb_eArgError, "expected loop to be an instance of Coolio::Loop"); \
|
15
|
+
rb_raise(rb_eArgError, "expected loop to be an instance of Coolio::Loop, not %s", RSTRING_PTR(rb_inspect(loop))); \
|
16
16
|
\
|
17
17
|
Data_Get_Struct(watcher, struct Coolio_Watcher, watcher_data); \
|
18
18
|
Data_Get_Struct(loop, struct Coolio_Loop, loop_data); \
|
data/lib/cool.io/dns_resolver.rb
CHANGED
@@ -168,7 +168,7 @@ module Coolio
|
|
168
168
|
return unless rcode == 0
|
169
169
|
|
170
170
|
# Extract the question and answer counts
|
171
|
-
qdcount,
|
171
|
+
qdcount, _ancount = message[4..7].unpack('nn').map { |n| n.to_i }
|
172
172
|
|
173
173
|
# We only asked one question
|
174
174
|
return unless qdcount == 1
|
data/lib/cool.io/listener.rb
CHANGED
@@ -40,19 +40,31 @@ module Coolio
|
|
40
40
|
#########
|
41
41
|
|
42
42
|
# Coolio callback for handling new connections
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
43
|
+
unless RUBY_PLATFORM =~ /mingw|mswin/
|
44
|
+
def on_readable
|
45
|
+
begin
|
46
|
+
on_connection @listen_socket.accept_nonblock
|
47
|
+
rescue Errno::EAGAIN, Errno::ECONNABORTED
|
48
|
+
# EAGAIN can be triggered here if the socket is shared between
|
49
|
+
# multiple processes and a thundering herd is woken up to accept
|
50
|
+
# one connection, only one process will get the connection and
|
51
|
+
# the others will be awoken.
|
52
|
+
# ECONNABORTED is documented in accept() manpages but modern TCP
|
53
|
+
# stacks with syncookies and/or accept()-filtering for DoS
|
54
|
+
# protection do not see it. In any case this error is harmless
|
55
|
+
# and we should instead spend our time with clients that follow
|
56
|
+
# through on connection attempts.
|
57
|
+
end
|
58
|
+
end
|
59
|
+
else
|
60
|
+
def on_readable
|
61
|
+
begin
|
62
|
+
# In Windows, accept_nonblock() with multiple processes
|
63
|
+
# causes thundering herd problem.
|
64
|
+
# To avoid this, we need to use accept().
|
65
|
+
on_connection @listen_socket.accept
|
66
|
+
rescue Errno::EAGAIN, Errno::ECONNABORTED
|
67
|
+
end
|
56
68
|
end
|
57
69
|
end
|
58
70
|
end
|
data/lib/cool.io/meta.rb
CHANGED
data/lib/cool.io/socket.rb
CHANGED
data/lib/cool.io/version.rb
CHANGED
data/spec/stat_watcher_spec.rb
CHANGED
@@ -70,7 +70,11 @@ describe Cool.io::StatWatcher do
|
|
70
70
|
end
|
71
71
|
|
72
72
|
it "should raise when the handler does not take 2 parameters" do
|
73
|
-
class MyStatWatcher < Cool.io::StatWatcher
|
73
|
+
class MyStatWatcher < Cool.io::StatWatcher
|
74
|
+
remove_method :on_change
|
75
|
+
def on_change
|
76
|
+
end
|
77
|
+
end
|
74
78
|
expect { watcher.accessed }.to raise_error(ArgumentError)
|
75
79
|
end
|
76
80
|
|
data/spec/tcp_server_spec.rb
CHANGED
@@ -72,10 +72,10 @@ ensure
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def test_run_once_timeout(timeout = TIMEOUT)
|
75
|
+
@data = ""
|
75
76
|
reactor = Coolio::Loop.new
|
76
77
|
server = Cool.io::TCPServer.new(HOST, PORT, MyConnection, method(:on_message))
|
77
78
|
reactor.attach(server)
|
78
|
-
running = true
|
79
79
|
thread = Thread.new { reactor.run_once(timeout) }
|
80
80
|
sleep timeout
|
81
81
|
server.detach
|
@@ -198,7 +198,7 @@ describe Coolio::TCPServer do
|
|
198
198
|
end
|
199
199
|
def on_read(data)
|
200
200
|
@cb.call data
|
201
|
-
|
201
|
+
_size = write(data + "fff")
|
202
202
|
end
|
203
203
|
end
|
204
204
|
|
data/spec/unix_listener_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe Cool.io::UNIXListener, :env => :exclude_win do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
it "creates a new UNIXListener" do
|
13
|
-
|
13
|
+
_listener = Cool.io::UNIXListener.new(@tmp.path)
|
14
14
|
expect(File.socket?(@tmp.path)).to eq(true)
|
15
15
|
end
|
16
16
|
|
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.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: x86-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: 2016-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.
|
34
|
+
version: 0.5.1
|
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: 0.5.1
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- LICENSE
|
85
85
|
- README.md
|
86
86
|
- Rakefile
|
87
|
+
- appveyor.yml
|
87
88
|
- cool.io.gemspec
|
88
89
|
- examples/callbacked_echo_server.rb
|
89
90
|
- examples/dslified_echo_client.rb
|
@@ -130,6 +131,8 @@ files:
|
|
130
131
|
- lib/2.1/iobuffer_ext.so
|
131
132
|
- lib/2.2/cool.io_ext.so
|
132
133
|
- lib/2.2/iobuffer_ext.so
|
134
|
+
- lib/2.3/cool.io_ext.so
|
135
|
+
- lib/2.3/iobuffer_ext.so
|
133
136
|
- lib/cool.io.rb
|
134
137
|
- lib/cool.io/async_watcher.rb
|
135
138
|
- lib/cool.io/custom_require.rb
|
@@ -175,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
178
|
version: '0'
|
176
179
|
requirements: []
|
177
180
|
rubyforge_project:
|
178
|
-
rubygems_version: 2.
|
181
|
+
rubygems_version: 2.5.1
|
179
182
|
signing_key:
|
180
183
|
specification_version: 4
|
181
184
|
summary: A cool framework for doing high performance I/O in Ruby
|