libuv 0.11.2 → 0.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/Gemfile +2 -0
- data/Rakefile +1 -1
- data/lib/libuv/tcp.rb +16 -1
- data/lib/libuv/version.rb +1 -1
- data/libuv.gemspec +2 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fe9ee08be8c2527dd4810ff7683f399b646c0eb
|
4
|
+
data.tar.gz: 92d29fcd1707362680066afb0f21b45a2a1e7b84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e5865042d0c622d070b3c4d81a30b19f4c219e945ac3529df684d2b1d2066df7f94d2660b79ac6d36f679817f1a096474381c567f3543ba123d7c07b5617746
|
7
|
+
data.tar.gz: 9bb4ac8f38daba15b1a442abc4be838cec7d6f30e7959ec38318e8c9b99a8e3a9accde93aeb39ad5f877d18531e87be9110d9c21fc37f570f245e74d8375afbc
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'rspec/core/rake_task' # testing framework
|
|
3
3
|
require 'yard' # yard documentation
|
4
4
|
require 'ffi' # loads the extension
|
5
5
|
require 'rake/clean' # for the :clobber rake task
|
6
|
-
require 'libuv/ext/tasks'
|
6
|
+
require File.expand_path('../lib/libuv/ext/tasks', __FILE__) # platform specific rake tasks used by compile
|
7
7
|
|
8
8
|
|
9
9
|
|
data/lib/libuv/tcp.rb
CHANGED
@@ -11,12 +11,21 @@ module Libuv
|
|
11
11
|
TLS_ERROR = "TLS write failed".freeze
|
12
12
|
|
13
13
|
|
14
|
+
attr_reader :connected
|
15
|
+
|
16
|
+
|
14
17
|
def initialize(loop, acceptor = nil)
|
15
18
|
@loop = loop
|
16
19
|
|
17
20
|
tcp_ptr = ::Libuv::Ext.create_handle(:uv_tcp)
|
18
21
|
error = check_result(::Libuv::Ext.tcp_init(loop.handle, tcp_ptr))
|
19
|
-
|
22
|
+
|
23
|
+
if acceptor && error.nil?
|
24
|
+
error = check_result(::Libuv::Ext.accept(acceptor, tcp_ptr))
|
25
|
+
@connected = true
|
26
|
+
else
|
27
|
+
@connected = false
|
28
|
+
end
|
20
29
|
|
21
30
|
super(tcp_ptr, error)
|
22
31
|
end
|
@@ -27,6 +36,8 @@ module Libuv
|
|
27
36
|
# --------------------------------------
|
28
37
|
#
|
29
38
|
def start_tls(args = {})
|
39
|
+
return unless @connected && @tls.nil?
|
40
|
+
|
30
41
|
@handshake = false
|
31
42
|
@pending_writes = []
|
32
43
|
@tls = ::RubyTls::Connection.new(self)
|
@@ -79,6 +90,8 @@ module Libuv
|
|
79
90
|
# overwrite the default close to ensure
|
80
91
|
# pending writes are rejected
|
81
92
|
def close
|
93
|
+
@connected = false
|
94
|
+
|
82
95
|
if not @pending_writes.nil?
|
83
96
|
@pending_writes.each do |deferred, data|
|
84
97
|
deferred.reject(TLS_ERROR)
|
@@ -229,6 +242,8 @@ module Libuv
|
|
229
242
|
|
230
243
|
def on_connect(req, status)
|
231
244
|
::Libuv::Ext.free(req)
|
245
|
+
@connected = true
|
246
|
+
|
232
247
|
begin
|
233
248
|
@callback.call(self)
|
234
249
|
rescue Exception => e
|
data/lib/libuv/version.rb
CHANGED
data/libuv.gemspec
CHANGED
@@ -17,7 +17,8 @@ Gem::Specification.new do |gem|
|
|
17
17
|
|
18
18
|
gem.add_runtime_dependency 'ffi', '>= 1.9'
|
19
19
|
gem.add_runtime_dependency 'thread_safe'
|
20
|
-
gem.add_runtime_dependency 'ruby-tls'
|
20
|
+
gem.add_runtime_dependency 'ruby-tls', '>= 1.0.1'
|
21
|
+
|
21
22
|
gem.add_development_dependency 'rspec', '>= 2.14'
|
22
23
|
gem.add_development_dependency 'rake', '>= 10.1'
|
23
24
|
gem.add_development_dependency 'yard'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libuv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bulat Shakirzyanov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 1.0.1
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 1.0.1
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rspec
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|