eventmachine 1.2.2-java → 1.2.3-java

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: dda1851dda6b43b1cdab3099c9027cbf44ebc3c4
4
- data.tar.gz: 836c4e645e1a05ba2f3c0dc1cb2c6c2013208559
3
+ metadata.gz: 0d34f043edad6064ae6a30793513c5b36468f2ad
4
+ data.tar.gz: a942ce325fbc4a0f9e8e3a1bd729a53fe4eba37a
5
5
  SHA512:
6
- metadata.gz: 3605cfbee0486eb0d38647ff0def7c015eef30ef10cf1127df340d280c50d395160b1c28972ee3a4abdb61f22507614a8eb68d568620edac4a7c8036bebff916
7
- data.tar.gz: eb103b538060cc26095c74a284b1b07465b5544a738aeda3f78acf046c016deda7fe62f959f617401c4ff3e7f1d227d3205900d867b3ac7abe5ffe60d5a4838a
6
+ metadata.gz: c672d86005b527c946d82656d3dc7291fd8540d53acf944535fb03aa7ac468f96ccdb9537e81aa08137e3821394333a6db0fd87a984ea9b8fcfccf2c3b3d18cb
7
+ data.tar.gz: c012983ac47592012d78f6782d6b5e55ce160ce914ff6e3b123a429e9faacf6d46e7fd9649fa3e06a12e5f3614d0e15445ac1ebd69898242b28f6c255c802f07
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## 1.2.2 (January 23, 2016)
3
+ ## 1.2.3 (February 22, 2017)
4
+ * Pure Ruby: Add get_sockname [#308, #772]
5
+ * Fix segfault when an Exception is raised from unbind callback [#765, #766]
6
+ * Allow destructors to throw when compiling in >= C++11 [#767]
7
+
8
+ ## 1.2.2 (January 23, 2017)
4
9
  * Java: Fix Fixnum deprecated warning in Ruby 2.4+ [#759]
5
10
  * Fix uncaught C++ exception in file watcher and raise InvalidSignature [#512, #757]
6
11
  * Fix connection count off-by-one for epoll and kqueue [#750]
data/ext/binder.cpp CHANGED
@@ -116,7 +116,7 @@ Bindable_t::Bindable_t()
116
116
  Bindable_t::~Bindable_t
117
117
  ***********************/
118
118
 
119
- Bindable_t::~Bindable_t()
119
+ Bindable_t::~Bindable_t() NO_EXCEPT_FALSE
120
120
  {
121
121
  BindingBag.erase (Binding);
122
122
  }
data/ext/binder.h CHANGED
@@ -21,6 +21,12 @@ See the file COPYING for complete licensing information.
21
21
  #define __ObjectBindings__H_
22
22
 
23
23
 
24
+ #if __cplusplus >= 201103L
25
+ #define NO_EXCEPT_FALSE noexcept(false)
26
+ #else
27
+ #define NO_EXCEPT_FALSE
28
+ #endif
29
+
24
30
  class Bindable_t
25
31
  {
26
32
  public:
@@ -30,7 +36,7 @@ class Bindable_t
30
36
 
31
37
  public:
32
38
  Bindable_t();
33
- virtual ~Bindable_t();
39
+ virtual ~Bindable_t() NO_EXCEPT_FALSE;
34
40
 
35
41
  const uintptr_t GetBinding() {return Binding;}
36
42
 
data/ext/ed.cpp CHANGED
@@ -126,7 +126,7 @@ EventableDescriptor::EventableDescriptor (SOCKET sd, EventMachine_t *em):
126
126
  EventableDescriptor::~EventableDescriptor
127
127
  *****************************************/
128
128
 
129
- EventableDescriptor::~EventableDescriptor()
129
+ EventableDescriptor::~EventableDescriptor() NO_EXCEPT_FALSE
130
130
  {
131
131
  if (NextHeartbeat)
132
132
  MyEventMachine->ClearHeartbeat(NextHeartbeat, this);
data/ext/ed.h CHANGED
@@ -37,7 +37,7 @@ class EventableDescriptor: public Bindable_t
37
37
  {
38
38
  public:
39
39
  EventableDescriptor (SOCKET, EventMachine_t*);
40
- virtual ~EventableDescriptor();
40
+ virtual ~EventableDescriptor() NO_EXCEPT_FALSE;
41
41
 
42
42
  SOCKET GetSocket() {return MySocket;}
43
43
  void SetSocketInvalid() { MySocket = INVALID_SOCKET; }
@@ -365,7 +365,7 @@ class PipeDescriptor: public EventableDescriptor
365
365
  {
366
366
  public:
367
367
  PipeDescriptor (SOCKET, pid_t, EventMachine_t*);
368
- virtual ~PipeDescriptor();
368
+ virtual ~PipeDescriptor() NO_EXCEPT_FALSE;
369
369
 
370
370
  virtual void Read();
371
371
  virtual void Write();
data/ext/em.cpp CHANGED
@@ -164,6 +164,8 @@ EventMachine_t::~EventMachine_t()
164
164
  {
165
165
  // Run down descriptors
166
166
  size_t i;
167
+ for (i = 0; i < DescriptorsToDelete.size(); i++)
168
+ delete DescriptorsToDelete[i];
167
169
  for (i = 0; i < NewDescriptors.size(); i++)
168
170
  delete NewDescriptors[i];
169
171
  for (i = 0; i < Descriptors.size(); i++)
@@ -840,6 +842,17 @@ void EventMachine_t::_CleanupSockets()
840
842
  EventableDescriptor *ed = Descriptors[i];
841
843
  assert (ed);
842
844
  if (ed->ShouldDelete()) {
845
+ DescriptorsToDelete.push_back(ed);
846
+ }
847
+ else
848
+ Descriptors [j++] = ed;
849
+ }
850
+ while ((size_t)j < Descriptors.size())
851
+ Descriptors.pop_back();
852
+
853
+ nSockets = DescriptorsToDelete.size();
854
+ for (i=0; i < nSockets; i++) {
855
+ EventableDescriptor *ed = DescriptorsToDelete[i];
843
856
  #ifdef HAVE_EPOLL
844
857
  if (Poller == Poller_Epoll) {
845
858
  assert (epfd != -1);
@@ -855,13 +868,9 @@ void EventMachine_t::_CleanupSockets()
855
868
  ModifiedDescriptors.erase(ed);
856
869
  }
857
870
  #endif
858
- delete ed;
859
- }
860
- else
861
- Descriptors [j++] = ed;
871
+ delete ed;
862
872
  }
863
- while ((size_t)j < Descriptors.size())
864
- Descriptors.pop_back();
873
+ DescriptorsToDelete.clear();
865
874
  }
866
875
 
867
876
  /*********************************
data/ext/em.h CHANGED
@@ -242,6 +242,7 @@ class EventMachine_t
242
242
  map<int, Bindable_t*> Pids;
243
243
  vector<EventableDescriptor*> Descriptors;
244
244
  vector<EventableDescriptor*> NewDescriptors;
245
+ vector<EventableDescriptor*> DescriptorsToDelete;
245
246
  set<EventableDescriptor*> ModifiedDescriptors;
246
247
 
247
248
  SOCKET LoopBreakerReader;
data/ext/extconf.rb CHANGED
@@ -70,7 +70,7 @@ def pkg_config_wrapper(pretty_name, name)
70
70
  end
71
71
 
72
72
  if ENV['CROSS_COMPILING']
73
- openssl_version = ENV.fetch("OPENSSL_VERSION", "1.0.2j")
73
+ openssl_version = ENV.fetch("OPENSSL_VERSION", "1.0.2e")
74
74
  openssl_dir = File.expand_path("~/.rake-compiler/builds/openssl-#{openssl_version}/")
75
75
  if File.exist?(openssl_dir)
76
76
  FileUtils.mkdir_p Dir.pwd+"/openssl/"
data/ext/pipe.cpp CHANGED
@@ -46,7 +46,7 @@ PipeDescriptor::PipeDescriptor (int fd, pid_t subpid, EventMachine_t *parent_em)
46
46
  PipeDescriptor::~PipeDescriptor
47
47
  *******************************/
48
48
 
49
- PipeDescriptor::~PipeDescriptor()
49
+ PipeDescriptor::~PipeDescriptor() NO_EXCEPT_FALSE
50
50
  {
51
51
  // Run down any stranded outbound data.
52
52
  for (size_t i=0; i < OutboundPages.size(); i++)
data/lib/em/pure_ruby.rb CHANGED
@@ -214,6 +214,12 @@ module EventMachine
214
214
  selectable.get_peername
215
215
  end
216
216
 
217
+ # @private
218
+ def get_sockname sig
219
+ selectable = Reactor.instance.get_selectable( sig ) or raise "unknown get_sockname target"
220
+ selectable.get_sockname
221
+ end
222
+
217
223
  # @private
218
224
  def open_udp_socket host, port
219
225
  EvmaUDPSocket.create(host, port).uuid
@@ -657,6 +663,7 @@ class IO
657
663
  def_delegator :@my_selectable, :send_data
658
664
  def_delegator :@my_selectable, :schedule_close
659
665
  def_delegator :@my_selectable, :get_peername
666
+ def_delegator :@my_selectable, :get_sockname
660
667
  def_delegator :@my_selectable, :send_datagram
661
668
  def_delegator :@my_selectable, :get_outbound_data_size
662
669
  def_delegator :@my_selectable, :set_inactivity_timeout
@@ -716,6 +723,10 @@ module EventMachine
716
723
  nil
717
724
  end
718
725
 
726
+ def get_sockname
727
+ nil
728
+ end
729
+
719
730
  def set_inactivity_timeout tm
720
731
  @inactivity_timeout = tm
721
732
  end
@@ -847,6 +858,14 @@ module EventMachine
847
858
  io.getpeername
848
859
  end
849
860
 
861
+ # #get_sockname
862
+ # This is defined in the normal way on connected stream objects.
863
+ # Return an object that is suitable for passing to Socket#unpack_sockaddr_in or variants.
864
+ # We could also use a convenience method that did the unpacking automatically.
865
+ def get_sockname
866
+ io.getsockname
867
+ end
868
+
850
869
  # #get_outbound_data_size
851
870
  def get_outbound_data_size
852
871
  @outbound_q.inject(0) {|memo,obj| memo += (obj || "").length}
data/lib/em/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module EventMachine
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
data/tests/test_exc.rb CHANGED
@@ -1,6 +1,13 @@
1
1
  require 'em_test_helper'
2
2
 
3
3
  class TestSomeExceptions < Test::Unit::TestCase
4
+ class DoomedConnectionError < StandardError
5
+ end
6
+ class DoomedConnection < EventMachine::Connection
7
+ def unbind
8
+ raise DoomedConnectionError
9
+ end
10
+ end
4
11
 
5
12
  # Read the commentary in EM#run.
6
13
  # This test exercises the ensure block in #run that makes sure
@@ -25,4 +32,12 @@ class TestSomeExceptions < Test::Unit::TestCase
25
32
  }
26
33
  end
27
34
 
35
+ def test_exception_on_unbind
36
+ assert_raises(DoomedConnectionError) {
37
+ EM.run {
38
+ EM.connect("localhost", 8888, DoomedConnection)
39
+ }
40
+ }
41
+ end
42
+
28
43
  end
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.2
4
+ version: 1.2.3
5
5
  platform: java
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-01-31 00:00:00.000000000 Z
12
+ date: 2017-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement