eventmachine 1.2.3 → 1.2.5

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: c795c80fc92f16416a7a88c0f81047d0d016ed60
4
- data.tar.gz: 53eef8509e66f01d28dcb5a19a52893bcec527cf
3
+ metadata.gz: 9bbf7706d51492b350b6fd9129a08fc21b935656
4
+ data.tar.gz: 4d0148fb3dd9c072383b0df0376dcbe755b87115
5
5
  SHA512:
6
- metadata.gz: 83002fd70bd092a2b57b4ff6e1c451e6ad30a7e5d7dc29365139ad517ef417c09b1aa4655a8c220def9a0ffa32594c510ec2a547f195c1066aa610a4c515ee29
7
- data.tar.gz: a9efa0f099ef1ec3d0ae7a87da91a1f768cc5f7995e9df7f5cce529018217e6a6277a263a42bf294dfa61625780a89afb613d3a08646e90d8391442b09e1148f
6
+ metadata.gz: 9395c7a5a3adcce10e2552bafebc1ed6d8023b6fcd3cfd3c95afc8871ab5f3ef4c694c35484a160ac25b684be48cbd65216e6a4f6a1b4210b6671dd4e3e89f00
7
+ data.tar.gz: 042dcb41e20266c6aa74c9e94e09f3edc67c7802247e900f51fb6c753f2d5016ffe8b6ab27c722b893145a35341ae618985f9adad0d2c05082996599e3eda08c
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.5 (July 27, 2017)
4
+ * Java: Use long for larger values in oneshot timer intervals [#784, #794]
5
+
6
+ ## 1.2.4 (July 27, 2017)
7
+ * Java: Add EM_PROTO_SSL/TLS definitions [#773, #791]
8
+ * Fix IPv6 UDP get_peername [#788]
9
+ * Allow for larger values in oneshot timer intervals [#784, #793]
10
+ * Update extconf.rb to allow MinGW builds with OpenSSL 1.1.0 [#785]
11
+
3
12
  ## 1.2.3 (February 22, 2017)
4
13
  * Pure Ruby: Add get_sockname [#308, #772]
5
14
  * Fix segfault when an Exception is raised from unbind callback [#765, #766]
@@ -100,10 +100,10 @@ extern "C" void evma_run_machine()
100
100
  evma_install_oneshot_timer
101
101
  **************************/
102
102
 
103
- extern "C" const uintptr_t evma_install_oneshot_timer (int seconds)
103
+ extern "C" const uintptr_t evma_install_oneshot_timer (uint64_t milliseconds)
104
104
  {
105
105
  ensure_eventmachine("evma_install_oneshot_timer");
106
- return EventMachine->InstallOneshotTimer (seconds);
106
+ return EventMachine->InstallOneshotTimer (milliseconds);
107
107
  }
108
108
 
109
109
 
data/ext/ed.cpp CHANGED
@@ -2002,8 +2002,8 @@ bool DatagramDescriptor::GetPeername (struct sockaddr *s, socklen_t *len)
2002
2002
  {
2003
2003
  bool ok = false;
2004
2004
  if (s) {
2005
- *len = sizeof(struct sockaddr);
2006
- memset (s, 0, sizeof(struct sockaddr));
2005
+ *len = sizeof(ReturnAddress);
2006
+ memset (s, 0, sizeof(ReturnAddress));
2007
2007
  memcpy (s, &ReturnAddress, sizeof(ReturnAddress));
2008
2008
  ok = true;
2009
2009
  }
data/ext/em.cpp CHANGED
@@ -1151,7 +1151,7 @@ void EventMachine_t::_RunTimers()
1151
1151
  EventMachine_t::InstallOneshotTimer
1152
1152
  ***********************************/
1153
1153
 
1154
- const uintptr_t EventMachine_t::InstallOneshotTimer (int milliseconds)
1154
+ const uintptr_t EventMachine_t::InstallOneshotTimer (uint64_t milliseconds)
1155
1155
  {
1156
1156
  if (Timers.size() > MaxOutstandingTimers)
1157
1157
  return false;
data/ext/em.h CHANGED
@@ -142,7 +142,7 @@ class EventMachine_t
142
142
  void ScheduleHalt();
143
143
  bool Stopping();
144
144
  void SignalLoopBreaker();
145
- const uintptr_t InstallOneshotTimer (int);
145
+ const uintptr_t InstallOneshotTimer (uint64_t);
146
146
  const uintptr_t ConnectToServer (const char *, int, const char *, int);
147
147
  const uintptr_t ConnectToUnixServer (const char *);
148
148
 
@@ -51,7 +51,7 @@ extern "C" {
51
51
  bool evma_run_machine_once();
52
52
  void evma_run_machine();
53
53
  void evma_release_library();
54
- const uintptr_t evma_install_oneshot_timer (int seconds);
54
+ const uintptr_t evma_install_oneshot_timer (uint64_t milliseconds);
55
55
  const uintptr_t evma_connect_to_server (const char *bind_addr, int bind_port, const char *server, int port);
56
56
  const uintptr_t evma_connect_to_unix_server (const char *server);
57
57
 
@@ -26,10 +26,10 @@ def append_library(libs, lib)
26
26
  end
27
27
 
28
28
  SSL_HEADS = %w(openssl/ssl.h openssl/err.h)
29
- SSL_LIBS = case RUBY_PLATFORM
30
- when /mswin|mingw|bccwin/ ; %w(ssleay32 libeay32)
31
- else ; %w(crypto ssl)
32
- end
29
+ SSL_LIBS = %w(crypto ssl)
30
+ # OpenSSL 1.1.0 and above for Windows use the Unix library names
31
+ # OpenSSL 0.9.8 and 1.0.x for Windows use the *eay32 library names
32
+ SSL_LIBS_WIN = RUBY_PLATFORM =~ /mswin|mingw|bccwin/ ? %w(ssleay32 libeay32) : []
33
33
 
34
34
  def dir_config_wrapper(pretty_name, name, idefault=nil, ldefault=nil)
35
35
  inc, lib = dir_config(name, idefault, ldefault)
@@ -88,15 +88,15 @@ if ENV['CROSS_COMPILING']
88
88
  end
89
89
  elsif dir_config_wrapper('OpenSSL', 'ssl')
90
90
  # If the user has provided a --with-ssl-dir argument, we must respect it or fail.
91
- add_define 'WITH_SSL' if check_libs(SSL_LIBS) && check_heads(SSL_HEADS)
91
+ add_define 'WITH_SSL' if (check_libs(SSL_LIBS) || check_libs(SSL_LIBS_WIN)) && check_heads(SSL_HEADS)
92
92
  elsif pkg_config_wrapper('OpenSSL', 'openssl')
93
93
  # If we can detect OpenSSL by pkg-config, use it as the next-best option
94
- add_define 'WITH_SSL' if check_libs(SSL_LIBS) && check_heads(SSL_HEADS)
95
- elsif check_libs(SSL_LIBS) && check_heads(SSL_HEADS)
94
+ add_define 'WITH_SSL' if (check_libs(SSL_LIBS) || check_libs(SSL_LIBS_WIN)) && check_heads(SSL_HEADS)
95
+ elsif (check_libs(SSL_LIBS) || check_libs(SSL_LIBS_WIN)) && check_heads(SSL_HEADS)
96
96
  # If we don't even need any options to find a usable OpenSSL, go with it
97
97
  add_define 'WITH_SSL'
98
98
  elsif dir_config_search('OpenSSL', 'ssl', ['/usr/local', '/opt/local', '/usr/local/opt/openssl']) do
99
- check_libs(SSL_LIBS) && check_heads(SSL_HEADS)
99
+ (check_libs(SSL_LIBS) || check_libs(SSL_LIBS_WIN)) && check_heads(SSL_HEADS)
100
100
  end
101
101
  # Finally, look for OpenSSL in alternate locations including MacPorts and HomeBrew
102
102
  add_define 'WITH_SSL'
@@ -262,7 +262,7 @@ t_add_oneshot_timer
262
262
 
263
263
  static VALUE t_add_oneshot_timer (VALUE self UNUSED, VALUE interval)
264
264
  {
265
- const uintptr_t f = evma_install_oneshot_timer (FIX2INT (interval));
265
+ const uintptr_t f = evma_install_oneshot_timer (FIX2LONG (interval));
266
266
  if (!f)
267
267
  rb_raise (rb_eRuntimeError, "%s", "ran out of timers; use #set_max_timers to increase limit");
268
268
  return BSIG2NUM (f);
@@ -48,7 +48,13 @@ public class EmReactor {
48
48
  public final int EM_SSL_HANDSHAKE_COMPLETED = 108;
49
49
  public final int EM_SSL_VERIFY = 109;
50
50
  public final int EM_PROXY_TARGET_UNBOUND = 110;
51
- public final int EM_PROXY_COMPLETED = 111;
51
+ public final int EM_PROXY_COMPLETED = 111;
52
+
53
+ public final int EM_PROTO_SSLv2 = 2;
54
+ public final int EM_PROTO_SSLv3 = 4;
55
+ public final int EM_PROTO_TLSv1 = 8;
56
+ public final int EM_PROTO_TLSv1_1 = 16;
57
+ public final int EM_PROTO_TLSv1_2 = 32;
52
58
 
53
59
  private Selector mySelector;
54
60
  private TreeMap<Long, ArrayList<Long>> Timers;
@@ -373,7 +379,7 @@ public class EmReactor {
373
379
  }
374
380
  }
375
381
 
376
- public long installOneshotTimer (int milliseconds) {
382
+ public long installOneshotTimer (long milliseconds) {
377
383
  long s = createBinding();
378
384
  long deadline = new Date().getTime() + milliseconds;
379
385
 
@@ -1,3 +1,3 @@
1
1
  module EventMachine
2
- VERSION = "1.2.3"
2
+ VERSION = "1.2.5"
3
3
  end
@@ -35,11 +35,13 @@ class TestIPv6 < Test::Unit::TestCase
35
35
  def test_ipv6_udp_local_server
36
36
  @@received_data = nil
37
37
  @local_port = next_port
38
+ @@remote_ip = nil
38
39
  setup_timeout(2)
39
40
 
40
41
  EM.run do
41
42
  EM.open_datagram_socket(@@public_ipv6, @local_port) do |s|
42
43
  def s.receive_data data
44
+ _port, @@remote_ip = Socket.unpack_sockaddr_in(s.get_peername)
43
45
  @@received_data = data
44
46
  EM.stop
45
47
  end
@@ -49,7 +51,7 @@ class TestIPv6 < Test::Unit::TestCase
49
51
  c.send_datagram "ipv6/udp", @@public_ipv6, @local_port
50
52
  end
51
53
  end
52
-
54
+ assert_equal @@remote_ip, @@public_ipv6
53
55
  assert_equal "ipv6/udp", @@received_data
54
56
  end
55
57
 
@@ -1,3 +1,5 @@
1
+ require 'em_test_helper'
2
+
1
3
  class TestThreadedResource < Test::Unit::TestCase
2
4
  def object
3
5
  @object ||= {}
@@ -93,6 +93,13 @@ class TestTimers < Test::Unit::TestCase
93
93
  assert_equal 4, x
94
94
  end
95
95
 
96
+ def test_oneshot_timer_large_future_value
97
+ large_value = 11948602000
98
+ EM.run {
99
+ EM.add_timer(large_value) { EM.stop }
100
+ EM.add_timer(0.02) { EM.stop }
101
+ }
102
+ end
96
103
 
97
104
  # This test is only applicable to compiled versions of the reactor.
98
105
  # Pure ruby and java versions have no built-in limit on the number of outstanding timers.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventmachine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Cianfrocca
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-23 00:00:00.000000000 Z
12
+ date: 2017-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement