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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 336a0c0476d19190a108a8e7be9513be3d5f3446
4
- data.tar.gz: 5fcd039e7c42068f1bcfbea5ba3db0020cc049d8
3
+ metadata.gz: e268c978613e1c65e2f7ac2926feba75e1712661
4
+ data.tar.gz: 0834ac09de1ee43e0c0804a2578f60c299c3846d
5
5
  SHA512:
6
- metadata.gz: b5fbb307e019c62bee59aaab8caf46cccd36876a7a257788c7e2b9df23ae3f9bedfb700240359d8409138a9b2868e301e042fd32876724c66a688f4b9ea944d0
7
- data.tar.gz: 2ad9a28a82f81be518a72d276d5de1dc215ac1253392915e4fb6fb460d066dc6b5ddecf0026c29d64e0be98293c38b1eaeab2afe880c50672887ccf877361edf
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], :int64, :blocking => true
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
@@ -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
@@ -44,7 +44,7 @@ module Libuv
44
44
  def close
45
45
  return if @closed
46
46
  @closed = true
47
- Libuv::Ext.close(handle, callback(:on_close))
47
+ ::Libuv::Ext.close(handle, callback(:on_close))
48
48
  end
49
49
 
50
50
  def active?
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
- buffer[:len] = suggested_size
200
- buffer[:base] = ::Libuv::Ext.malloc(suggested_size)
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
- ::Libuv::Ext.free(base)
209
- reject(e)
210
- else
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(UV::Sockaddr.new(sockaddr))
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
@@ -1,3 +1,3 @@
1
1
  module Libuv
2
- VERSION = '0.11.19'
2
+ VERSION = '0.11.20'
3
3
  end
data/spec/async_spec.rb CHANGED
@@ -6,7 +6,7 @@ describe Libuv::Async do
6
6
  @log = []
7
7
  @general_failure = []
8
8
 
9
- @loop = Libuv::Loop.new
9
+ @loop = Libuv::Loop.default
10
10
  @call = @loop.pipe
11
11
  @timeout = @loop.timer do
12
12
  @loop.stop
data/spec/defer_spec.rb CHANGED
@@ -4,7 +4,7 @@ require 'libuv'
4
4
  describe Libuv::Q do
5
5
 
6
6
  before :each do
7
- @loop = Libuv::Loop.new
7
+ @loop = Libuv::Loop.default
8
8
  @deferred = @loop.defer
9
9
  @promise = @deferred.promise
10
10
  @log = []
data/spec/dns_spec.rb CHANGED
@@ -6,7 +6,7 @@ describe Libuv::Dns do
6
6
  @log = []
7
7
  @general_failure = []
8
8
 
9
- @loop = Libuv::Loop.new
9
+ @loop = Libuv::Loop.default
10
10
  @timeout = @loop.timer do
11
11
  @loop.stop
12
12
  @general_failure << "test timed out"
@@ -7,7 +7,7 @@ describe Libuv::Filesystem do
7
7
  @log = []
8
8
  @general_failure = []
9
9
 
10
- @loop = Libuv::Loop.new
10
+ @loop = Libuv::Loop.default
11
11
  @filesystem = @loop.filesystem
12
12
  @timeout = @loop.timer do
13
13
  @loop.stop
data/spec/idle_spec.rb CHANGED
@@ -6,7 +6,7 @@ describe Libuv::Idle do
6
6
  @log = []
7
7
  @general_failure = []
8
8
 
9
- @loop = Libuv::Loop.new
9
+ @loop = Libuv::Loop.default
10
10
  @server = @loop.pipe
11
11
  @client = @loop.pipe
12
12
  @timeout = @loop.timer do
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.19
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-08 00:00:00.000000000 Z
12
+ date: 2014-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi