cool.io 1.6.0-x86-mingw32 → 1.7.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -6
- data/CHANGES.md +15 -0
- data/cool.io.gemspec +1 -0
- data/ext/cool.io/cool.io.h +11 -0
- data/ext/cool.io/extconf.rb +8 -0
- data/ext/cool.io/iowatcher.c +4 -0
- data/ext/cool.io/loop.c +0 -1
- data/ext/cool.io/utils.c +5 -0
- data/ext/iobuffer/extconf.rb +2 -2
- data/ext/libev/ev.c +3 -0
- data/lib/cool.io/dns_resolver.rb +9 -0
- data/lib/cool.io/version.rb +1 -1
- data/spec/dns_spec.rb +7 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6cc1b6e643d2669175307fce9d338b1bbe98f56a07a4e146b4dc28a8f3d4a62
|
4
|
+
data.tar.gz: 16a33766592e37465c6ea41c4d0c37c58b0860b863d810483c9f4b9fd2d3012b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26a549f29666717283736d93459027ad3641595625a3de02b52254c367649239deff6c8277b3f320fdf0c607449ddef3e06bdacc9ab74d988cb98850ab61ee53
|
7
|
+
data.tar.gz: 850ff54339b01e1a5d2c6ad35d5dea5b16db49b389949f834b35e209f4c823444eb46ce5144c0715b0217cf9aed9a856a3eaee13615c8dfcf4106fc27519b856
|
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
data/cool.io.gemspec
CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = "A cool framework for doing high performance I/O in Ruby"
|
12
12
|
s.description = "Cool.io provides a high performance event framework for Ruby which uses the libev C library"
|
13
13
|
s.extensions = ["ext/cool.io/extconf.rb", "ext/iobuffer/extconf.rb"]
|
14
|
+
s.licenses = ["MIT"]
|
14
15
|
|
15
16
|
s.files = `git ls-files`.split("\n")
|
16
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/ext/cool.io/cool.io.h
CHANGED
@@ -8,7 +8,11 @@
|
|
8
8
|
#define COOLIO_H
|
9
9
|
|
10
10
|
#include "ruby.h"
|
11
|
+
#if defined(HAVE_RUBY_IO_H)
|
12
|
+
#include "ruby/io.h"
|
13
|
+
#else
|
11
14
|
#include "rubyio.h"
|
15
|
+
#endif
|
12
16
|
|
13
17
|
#ifdef GetReadFile
|
14
18
|
#define FPTR_TO_FD(fptr) (fileno(GetReadFile(fptr)))
|
@@ -56,4 +60,11 @@ struct Coolio_Watcher
|
|
56
60
|
|
57
61
|
void Coolio_Loop_process_event(VALUE watcher, int revents);
|
58
62
|
|
63
|
+
void Init_coolio_loop();
|
64
|
+
void Init_coolio_watcher();
|
65
|
+
void Init_coolio_iowatcher();
|
66
|
+
void Init_coolio_timer_watcher();
|
67
|
+
void Init_coolio_stat_watcher();
|
68
|
+
void Init_coolio_utils();
|
69
|
+
|
59
70
|
#endif
|
data/ext/cool.io/extconf.rb
CHANGED
@@ -10,6 +10,14 @@ have_func('rb_thread_alone')
|
|
10
10
|
have_func('rb_str_set_len')
|
11
11
|
have_library('rt', 'clock_gettime')
|
12
12
|
|
13
|
+
if have_header('ruby/io.h')
|
14
|
+
$defs << '-DHAVE_RUBY_IO_H'
|
15
|
+
end
|
16
|
+
|
17
|
+
if have_header('ruby/thread.h')
|
18
|
+
$defs << '-DHAVE_RUBY_THREAD_H'
|
19
|
+
end
|
20
|
+
|
13
21
|
if have_header('sys/select.h')
|
14
22
|
$defs << '-DEV_USE_SELECT'
|
15
23
|
end
|
data/ext/cool.io/iowatcher.c
CHANGED
data/ext/cool.io/loop.c
CHANGED
data/ext/cool.io/utils.c
CHANGED
data/ext/iobuffer/extconf.rb
CHANGED
@@ -2,8 +2,8 @@ require 'mkmf'
|
|
2
2
|
|
3
3
|
dir_config("iobuffer")
|
4
4
|
have_library("c", "main")
|
5
|
-
if have_macro("HAVE_RB_IO_T", "
|
6
|
-
have_struct_member("rb_io_t", "fd", "
|
5
|
+
if have_macro("HAVE_RB_IO_T", "ruby/io.h")
|
6
|
+
have_struct_member("rb_io_t", "fd", "ruby/io.h")
|
7
7
|
end
|
8
8
|
|
9
9
|
create_makefile("iobuffer_ext")
|
data/ext/libev/ev.c
CHANGED
@@ -39,6 +39,9 @@
|
|
39
39
|
|
40
40
|
/* ########## COOLIO PATCHERY HO! ########## */
|
41
41
|
#include "ruby.h"
|
42
|
+
#if defined(HAVE_RUBY_THREAD_H)
|
43
|
+
#include "ruby/thread.h"
|
44
|
+
#endif
|
42
45
|
/* ######################################## */
|
43
46
|
|
44
47
|
/* this big block deduces configuration from config.h */
|
data/lib/cool.io/dns_resolver.rb
CHANGED
@@ -49,6 +49,15 @@ module Coolio
|
|
49
49
|
entries.each { |e| hosts[e] ||= addr }
|
50
50
|
end
|
51
51
|
end
|
52
|
+
if hosts.empty?
|
53
|
+
# On Windows, there is a case that hosts file doesn't have entry by default
|
54
|
+
# and preferred IPv4/IPv6 behavior may be changed by registry key [1], so
|
55
|
+
# "localhost" should be resolved by getaddrinfo.
|
56
|
+
# (first[3] means preferred resolved IP address ::1 or 127.0.0.1)
|
57
|
+
# [1] https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-ipv6-in-windows
|
58
|
+
require "socket"
|
59
|
+
hosts["localhost"] = ::Socket.getaddrinfo("localhost", nil).first[3]
|
60
|
+
end
|
52
61
|
|
53
62
|
hosts[host]
|
54
63
|
end
|
data/lib/cool.io/version.rb
CHANGED
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: 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: 2021-02-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
@@ -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: []
|