libuv 0.11.19 → 0.11.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -4
- data/lib/libuv/ext/ext.rb +1 -1
- data/lib/libuv/ext/tasks/win.rb +4 -1
- data/lib/libuv/handle.rb +1 -1
- data/lib/libuv/udp.rb +25 -9
- data/lib/libuv/version.rb +1 -1
- data/spec/async_spec.rb +1 -1
- data/spec/defer_spec.rb +1 -1
- data/spec/dns_spec.rb +1 -1
- data/spec/filesystem_spec.rb +1 -1
- data/spec/idle_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e268c978613e1c65e2f7ac2926feba75e1712661
|
4
|
+
data.tar.gz: 0834ac09de1ee43e0c0804a2578f60c299c3846d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a99086624268922183b089b57e381970aa2cc8aeccab597c7b707208bbb98b124c5ec3db19262d5cfb5324126d02f653477b4a38c088c2a13c4faeff97d6f5d
|
7
|
+
data.tar.gz: 24f0360ef29265c19f5f8eb8af7b4d188d8c155a8d1a4d083ff9f0e2f0d124c2fcf1f62bdc1672b0b08062c56c5da1562e32cb7094e8a9ca63aad36dd3b5a5f3
|
data/README.md
CHANGED
@@ -54,13 +54,19 @@ or
|
|
54
54
|
### Prerequisites
|
55
55
|
|
56
56
|
* The installation requires __subversion__ to be installed on your system and available on the PATH
|
57
|
-
* Windows users will require a copy of Visual Studio 2010 or later. [Visual Studio Express](http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products) works fine.
|
58
|
-
|
59
|
-
or
|
60
|
-
|
61
57
|
* setting the environmental variable `USE_GLOBAL_LIBUV` will prevent compiling the packaged version.
|
62
58
|
* if you have a compatible `libuv.(so | dylib | dll)` on the PATH already
|
63
59
|
|
60
|
+
Windows users will additionally require:
|
61
|
+
|
62
|
+
- A copy of Visual Studio 2010 or later. [Visual Studio Express](http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products) works fine.
|
63
|
+
- A copy of [OpenSSL](http://slproweb.com/products/Win32OpenSSL.html) matching the installed ruby (x86 / x64)
|
64
|
+
- with the environmental variable `OPENSSL_CONF` Set `OPENSSL_CONF=X:\path_to\OpenSSL\bin\openssl.cfg`
|
65
|
+
- If using jRuby then [GCC](http://win-builds.org/stable/) is also required
|
66
|
+
- Setup the paths as described on the gcc page
|
67
|
+
- Add required environmental variable `set LIBRARY_PATH=X:\win-builds-64\lib;X:\win-builds-64\x86_64-w64-mingw32\lib`
|
68
|
+
|
69
|
+
|
64
70
|
|
65
71
|
## Libuv features supported
|
66
72
|
|
data/lib/libuv/ext/ext.rb
CHANGED
@@ -69,7 +69,7 @@ module Libuv
|
|
69
69
|
attach_function :run, :uv_run, [:uv_loop_t, :uv_run_mode], :int, :blocking => true
|
70
70
|
attach_function :stop, :uv_stop, [:uv_loop_t], :void, :blocking => true
|
71
71
|
attach_function :update_time, :uv_update_time, [:uv_loop_t], :void, :blocking => true
|
72
|
-
attach_function :now, :uv_now, [:uv_loop_t], :
|
72
|
+
attach_function :now, :uv_now, [:uv_loop_t], :uint64, :blocking => true
|
73
73
|
|
74
74
|
attach_function :backend_timeout, :uv_backend_timeout, [:uv_loop_t], :int, :blocking => true
|
75
75
|
attach_function :backend_fd, :uv_backend_fd, [:uv_loop_t], :int, :blocking => true
|
data/lib/libuv/ext/tasks/win.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
file "ext/libuv/Release/libuv.#{FFI::Platform::LIBSUFFIX}" do
|
2
|
+
target_arch = 'ia32'
|
3
|
+
target_arch = 'x64' if FFI::Platform.x64?
|
4
|
+
|
2
5
|
Dir.chdir("ext/libuv") do |path|
|
3
|
-
system 'vcbuild.bat', 'shared', 'release'
|
6
|
+
system 'vcbuild.bat', 'shared', 'release', target_arch
|
4
7
|
end
|
5
8
|
end
|
6
9
|
|
data/lib/libuv/handle.rb
CHANGED
data/lib/libuv/udp.rb
CHANGED
@@ -195,23 +195,35 @@ module Libuv
|
|
195
195
|
end
|
196
196
|
|
197
197
|
|
198
|
+
def on_close(pointer)
|
199
|
+
if @receive_buff
|
200
|
+
::Libuv::Ext.free(@receive_buff)
|
201
|
+
@receive_buff = nil
|
202
|
+
@receive_size = nil
|
203
|
+
end
|
204
|
+
|
205
|
+
super(pointer)
|
206
|
+
end
|
207
|
+
|
198
208
|
def on_allocate(client, suggested_size, buffer)
|
199
|
-
|
200
|
-
|
209
|
+
if @receive_buff.nil?
|
210
|
+
@receive_buff = ::Libuv::Ext.malloc(suggested_size)
|
211
|
+
@receive_size = suggested_size
|
212
|
+
end
|
213
|
+
|
214
|
+
buffer[:base] = @receive_buff
|
215
|
+
buffer[:len] = @receive_size
|
201
216
|
end
|
202
217
|
|
203
218
|
def on_recv(handle, nread, buf, sockaddr, flags)
|
204
219
|
e = check_result(nread)
|
205
|
-
base = buf[:base]
|
206
220
|
|
207
221
|
if e
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
data = base.read_string(nread)
|
212
|
-
::Libuv::Ext.free(base)
|
222
|
+
reject(e) # Will call close
|
223
|
+
elsif nread > 0
|
224
|
+
data = @receive_buff.read_string(nread)
|
213
225
|
unless sockaddr.null?
|
214
|
-
ip, port = get_ip_and_port(
|
226
|
+
ip, port = get_ip_and_port(sockaddr)
|
215
227
|
end
|
216
228
|
|
217
229
|
begin
|
@@ -219,6 +231,10 @@ module Libuv
|
|
219
231
|
rescue Exception => e
|
220
232
|
@loop.log :error, :udp_progress_cb, e
|
221
233
|
end
|
234
|
+
else
|
235
|
+
::Libuv::Ext.free(@receive_buff)
|
236
|
+
@receive_buff = nil
|
237
|
+
@receive_size = nil
|
222
238
|
end
|
223
239
|
end
|
224
240
|
end
|
data/lib/libuv/version.rb
CHANGED
data/spec/async_spec.rb
CHANGED
data/spec/defer_spec.rb
CHANGED
data/spec/dns_spec.rb
CHANGED
data/spec/filesystem_spec.rb
CHANGED
data/spec/idle_spec.rb
CHANGED
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.20
|
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: 2014-01-
|
12
|
+
date: 2014-01-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|