eventmachine 1.2.2-x86-mingw32 → 1.2.3-x86-mingw32

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: 7da92aa45c5a15427b4f22791b55c70432e2ff46
4
- data.tar.gz: 31c2fb1ef70b792868b994f217c66212ad312d40
3
+ metadata.gz: c50b47baa04781c3d3bf5e07cbd4f234853b7a9d
4
+ data.tar.gz: beb5882da20f780d625ae66bc94844fd1eef3481
5
5
  SHA512:
6
- metadata.gz: 5cecc62d68106d9490a2bfcceab90430efb2b12b76d46c1f10026013d69a5b2951d629262d7d4d9f7358327b09b250511ccd083b2864a076e0efe4de5f35d5de
7
- data.tar.gz: 8c1fa375528e06b5a30b00af87a0facd810ddd20c5ce0b70075dbf692766d3dcdda205c7be48ad1b1fd91da864a7f1ca650a5fb6efe46c700168172bb73e0724
6
+ metadata.gz: a43682017b880b27867b62e8f399d675c92a8f9aadaeed86af9cc669123e764743e73e957d053b255cb1f86aa6d4903fc3246ede5baa96adc8e0374e7a146044
7
+ data.tar.gz: 7202b1636a64fba08ea0ceb0f60fb4032c267040833d7fc6c62afd479febb83c2e9614f399c13a94b7818cdf0b07379b6f01028a5e30dc850515ee25baa57c2c
@@ -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]
@@ -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
  }
@@ -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;
@@ -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++)
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -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}
@@ -1,3 +1,3 @@
1
1
  module EventMachine
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -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: x86-mingw32
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-23 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
  name: test-unit