Hello community,
here is the log from the commit of package rubygem-eventmachine for
openSUSE:Factory checked in at 2018-05-16 18:43:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-eventmachine (Old)
and /work/SRC/openSUSE:Factory/.rubygem-eventmachine.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-eventmachine"
Wed May 16 18:43:28 2018 rev:19 rq:609103 version:1.2.7
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-eventmachine/rubygem-eventmachine.changes
2017-09-26 21:13:41.904504401 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-eventmachine.new/rubygem-eventmachine.changes
2018-05-16 18:44:53.284150534 +0200
@@ -1,0 +2,25 @@
+Wed May 16 07:59:04 UTC 2018 - [email protected]
+
+- updated to version 1.2.7
+ see installed CHANGELOG.md
+
+ ## 1.2.7 (May 12, 2018)
+ * Fix segfault on large numbers of connections [#843]
+
+-------------------------------------------------------------------
+Mon Apr 30 11:04:01 UTC 2018 - [email protected]
+
+- updated to version 1.2.6
+ see installed CHANGELOG.md
+
+ ## 1.2.6 (April 30, 2018)
+ * *Fix segfault when an Exception is raised from unbind callback (for real
this time!)*
+ * Fix race condition while initializing the machine [#756]
+ * Fix for newer compilers where bind() and std::bind() conflict [#830, #831]
+ * Be verbose about SSL connection errors [#807]
+ * Avoid explicitly calling class methods when in class scope
+ * Java: Add EM_PROTO_SSL/TLS definitions [#773, #791]
+ * Java: return zero when sending data to a closed connection [#475, #804]
+ * Pure Ruby: Connection::error? calls report_connection_error_status [#801]
+
+-------------------------------------------------------------------
Old:
----
eventmachine-1.2.5.gem
New:
----
eventmachine-1.2.7.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-eventmachine.spec ++++++
--- /var/tmp/diff_new_pack.mEINHJ/_old 2018-05-16 18:44:53.928127262 +0200
+++ /var/tmp/diff_new_pack.mEINHJ/_new 2018-05-16 18:44:53.928127262 +0200
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-eventmachine
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
#
Name: rubygem-eventmachine
-Version: 1.2.5
+Version: 1.2.7
Release: 0
%define mod_name eventmachine
%define mod_full_name %{mod_name}-%{version}
@@ -39,11 +39,11 @@
BuildRequires: %{rubygem rdoc > 3.10}
BuildRequires: ruby-macros >= 5
Url: http://rubyeventmachine.com
-Source: http://rubygems.org/gems/%{mod_full_name}.gem
+Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: rubygem-eventmachine-rpmlintrc
Source2: gem2rpm.yml
Summary: Ruby/EventMachine library
-License: Ruby or GPL-2.0
+License: Ruby OR GPL-2.0-only
Group: Development/Languages/Ruby
%description
++++++ eventmachine-1.2.5.gem -> eventmachine-1.2.7.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2017-07-28 08:45:28.000000000 +0200
+++ new/CHANGELOG.md 2018-05-12 14:24:09.000000000 +0200
@@ -1,5 +1,18 @@
# Changelog
+## 1.2.7 (May 12, 2018)
+* Fix segfault on large numbers of connections [#843]
+
+## 1.2.6 (April 30, 2018)
+* *Fix segfault when an Exception is raised from unbind callback (for real
this time!)*
+* Fix race condition while initializing the machine [#756]
+* Fix for newer compilers where bind() and std::bind() conflict [#830, #831]
+* Be verbose about SSL connection errors [#807]
+* Avoid explicitly calling class methods when in class scope
+* Java: Add EM_PROTO_SSL/TLS definitions [#773, #791]
+* Java: return zero when sending data to a closed connection [#475, #804]
+* Pure Ruby: Connection::error? calls report_connection_error_status [#801]
+
## 1.2.5 (July 27, 2017)
* Java: Use long for larger values in oneshot timer intervals [#784, #794]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2017-07-28 08:45:28.000000000 +0200
+++ new/README.md 2018-05-12 14:24:09.000000000 +0200
@@ -1,4 +1,4 @@
-# About EventMachine [](https://codeclimate.com/github/eventmachine/eventmachine)
+# About EventMachine [](https://travis-ci.org/eventmachine/eventmachine)
[](https://codeclimate.com/github/eventmachine/eventmachine/maintainability)
## What is EventMachine ##
@@ -32,7 +32,7 @@
## What platforms are supported by EventMachine? ##
-EventMachine supports Ruby 1.8.7 through 2.3, REE, JRuby and **works well on
Windows** as well
+EventMachine supports Ruby 1.8.7 through 2.6, REE, JRuby and **works well on
Windows** as well
as many operating systems from the Unix family (Linux, Mac OS X, BSD flavors).
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/binder.cpp new/ext/binder.cpp
--- old/ext/binder.cpp 2017-07-28 08:45:28.000000000 +0200
+++ new/ext/binder.cpp 2018-05-12 14:24:09.000000000 +0200
@@ -22,7 +22,7 @@
#define DEV_URANDOM "/dev/urandom"
-map<uintptr_t, Bindable_t*> Bindable_t::BindingBag;
+std::map<uintptr_t, Bindable_t*> Bindable_t::BindingBag;
/********************************
@@ -92,7 +92,7 @@
Bindable_t *Bindable_t::GetObject (const uintptr_t binding)
{
- map<uintptr_t, Bindable_t*>::const_iterator i = BindingBag.find
(binding);
+ std::map<uintptr_t, Bindable_t*>::const_iterator i = BindingBag.find
(binding);
if (i != BindingBag.end())
return i->second;
else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/binder.h new/ext/binder.h
--- old/ext/binder.h 2017-07-28 08:45:28.000000000 +0200
+++ new/ext/binder.h 2018-05-12 14:24:09.000000000 +0200
@@ -32,7 +32,7 @@
public:
static uintptr_t CreateBinding();
static Bindable_t *GetObject (const uintptr_t);
- static map<uintptr_t, Bindable_t*> BindingBag;
+ static std::map<uintptr_t, Bindable_t*> BindingBag;
public:
Bindable_t();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/ed.cpp new/ext/ed.cpp
--- old/ext/ed.cpp 2017-07-28 08:45:28.000000000 +0200
+++ new/ext/ed.cpp 2018-05-12 14:24:09.000000000 +0200
@@ -320,7 +320,7 @@
if (ProxyTarget) {
if (BytesToProxy > 0) {
- unsigned long proxied = min(BytesToProxy, size);
+ unsigned long proxied = std::min(BytesToProxy, size);
ProxyTarget->SendOutboundData(buf, proxied);
ProxiedBytes += (unsigned long) proxied;
BytesToProxy -= proxied;
@@ -1148,7 +1148,7 @@
#ifdef HAVE_WRITEV
if (!err) {
unsigned int sent = bytes_written;
- deque<OutboundPage>::iterator op = OutboundPages.begin();
+ std::deque<OutboundPage>::iterator op = OutboundPages.begin();
for (int i = 0; i < iovcnt; i++) {
if (iov[i].iov_len <= sent) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/ed.h new/ext/ed.h
--- old/ext/ed.h 2017-07-28 08:45:28.000000000 +0200
+++ new/ext/ed.h 2018-05-12 14:24:09.000000000 +0200
@@ -251,7 +251,7 @@
bool bReadAttemptedAfterClose;
bool bWriteAttemptedAfterClose;
- deque<OutboundPage> OutboundPages;
+ std::deque<OutboundPage> OutboundPages;
int OutboundDataSize;
#ifdef WITH_SSL
@@ -326,7 +326,7 @@
struct sockaddr_in6 From;
};
- deque<OutboundPage> OutboundPages;
+ std::deque<OutboundPage> OutboundPages;
int OutboundDataSize;
struct sockaddr_in6 ReturnAddress;
@@ -394,7 +394,7 @@
protected:
bool bReadAttemptedAfterClose;
- deque<OutboundPage> OutboundPages;
+ std::deque<OutboundPage> OutboundPages;
int OutboundDataSize;
pid_t SubprocessPid;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/em.cpp new/ext/em.cpp
--- old/ext/em.cpp 2017-07-28 08:45:28.000000000 +0200
+++ new/ext/em.cpp 2018-05-12 14:24:09.000000000 +0200
@@ -164,8 +164,6 @@
{
// Run down descriptors
size_t i;
- for (i = 0; i < DescriptorsToDelete.size(); i++)
- delete DescriptorsToDelete[i];
for (i = 0; i < NewDescriptors.size(); i++)
delete NewDescriptors[i];
for (i = 0; i < Descriptors.size(); i++)
@@ -176,7 +174,7 @@
// Remove any file watch descriptors
while(!Files.empty()) {
- map<int, Bindable_t*>::iterator f = Files.begin();
+ std::map<int, Bindable_t*>::iterator f = Files.begin();
UnwatchFile (f->first);
}
@@ -506,7 +504,7 @@
const EventableDescriptor *head = NULL;
while (true) {
- multimap<uint64_t,EventableDescriptor*>::iterator i =
Heartbeats.begin();
+ std::multimap<uint64_t,EventableDescriptor*>::iterator i =
Heartbeats.begin();
if (i == Heartbeats.end())
break;
if (i->first > MyCurrentLoopTime)
@@ -534,9 +532,9 @@
if (heartbeat) {
#ifndef HAVE_MAKE_PAIR
- Heartbeats.insert
(multimap<uint64_t,EventableDescriptor*>::value_type (heartbeat, ed));
+ Heartbeats.insert
(std::multimap<uint64_t,EventableDescriptor*>::value_type (heartbeat, ed));
#else
- Heartbeats.insert (make_pair (heartbeat, ed));
+ Heartbeats.insert (std::make_pair (heartbeat, ed));
#endif
}
}
@@ -547,8 +545,8 @@
void EventMachine_t::ClearHeartbeat(uint64_t key, EventableDescriptor* ed)
{
- multimap<uint64_t,EventableDescriptor*>::iterator it;
-
pair<multimap<uint64_t,EventableDescriptor*>::iterator,multimap<uint64_t,EventableDescriptor*>::iterator>
ret;
+ std::multimap<uint64_t,EventableDescriptor*>::iterator it;
+
std::pair<std::multimap<uint64_t,EventableDescriptor*>::iterator,std::multimap<uint64_t,EventableDescriptor*>::iterator>
ret;
ret = Heartbeats.equal_range (key);
for (it = ret.first; it != ret.second; ++it) {
if (it->second == ed) {
@@ -747,7 +745,7 @@
else if (ke->filter == EVFILT_WRITE)
ed->Write();
else
- cerr << "Discarding unknown kqueue
event " << ke->filter << endl;
+ std::cerr << "Discarding unknown kqueue
event " << ke->filter << std::endl;
break;
}
@@ -786,12 +784,12 @@
uint64_t current_time = GetRealTime();
if (!Heartbeats.empty()) {
- multimap<uint64_t,EventableDescriptor*>::iterator heartbeats =
Heartbeats.begin();
+ std::multimap<uint64_t,EventableDescriptor*>::iterator
heartbeats = Heartbeats.begin();
next_event = heartbeats->first;
}
if (!Timers.empty()) {
- multimap<uint64_t,Timer_t>::iterator timers = Timers.begin();
+ std::multimap<uint64_t,Timer_t>::iterator timers =
Timers.begin();
if (next_event == 0 || timers->first < next_event)
next_event = timers->first;
}
@@ -842,17 +840,6 @@
EventableDescriptor *ed = Descriptors[i];
assert (ed);
if (ed->ShouldDelete()) {
- DescriptorsToDelete.push_back(ed);
- }
- else
- Descriptors [j++] = ed;
- }
- while ((size_t)j < Descriptors.size())
- Descriptors.pop_back();
-
- nSockets = DescriptorsToDelete.size();
- for (i=0; i < nSockets; i++) {
- EventableDescriptor *ed = DescriptorsToDelete[i];
#ifdef HAVE_EPOLL
if (Poller == Poller_Epoll) {
assert (epfd != -1);
@@ -868,9 +855,13 @@
ModifiedDescriptors.erase(ed);
}
#endif
- delete ed;
+ delete ed;
+ }
+ else
+ Descriptors [j++] = ed;
}
- DescriptorsToDelete.clear();
+ while ((size_t)j < Descriptors.size())
+ Descriptors.pop_back();
}
/*********************************
@@ -925,7 +916,7 @@
static VALUE _SelectDataSelect (void *v)
{
SelectData_t *sd = (SelectData_t*)v;
- sd->nSockets = select (sd->maxsocket+1, rb_fd_ptr(&(sd->fdreads)),
rb_fd_ptr(&(sd->fdwrites)), rb_fd_ptr(&(sd->fderrors)), &(sd->tv));
+ sd->nSockets = rb_fd_select (sd->maxsocket+1, &(sd->fdreads),
&(sd->fdwrites), &(sd->fderrors), &(sd->tv));
return Qnil;
}
#endif
@@ -1134,7 +1125,7 @@
// one that hasn't expired yet.
while (true) {
- multimap<uint64_t,Timer_t>::iterator i = Timers.begin();
+ std::multimap<uint64_t,Timer_t>::iterator i = Timers.begin();
if (i == Timers.end())
break;
if (i->first > MyCurrentLoopTime)
@@ -1161,9 +1152,9 @@
Timer_t t;
#ifndef HAVE_MAKE_PAIR
- multimap<uint64_t,Timer_t>::iterator i = Timers.insert
(multimap<uint64_t,Timer_t>::value_type (fire_at, t));
+ std::multimap<uint64_t,Timer_t>::iterator i = Timers.insert
(std::multimap<uint64_t,Timer_t>::value_type (fire_at, t));
#else
- multimap<uint64_t,Timer_t>::iterator i = Timers.insert (make_pair
(fire_at, t));
+ std::multimap<uint64_t,Timer_t>::iterator i = Timers.insert
(std::make_pair (fire_at, t));
#endif
return i->second.GetBinding();
}
@@ -1840,7 +1831,7 @@
#ifdef HAVE_EPOLL
if (Poller == Poller_Epoll) {
- set<EventableDescriptor*>::iterator i =
ModifiedDescriptors.begin();
+ std::set<EventableDescriptor*>::iterator i =
ModifiedDescriptors.begin();
while (i != ModifiedDescriptors.end()) {
assert (*i);
_ModifyEpollEvent (*i);
@@ -1851,7 +1842,7 @@
#ifdef HAVE_KQUEUE
if (Poller == Poller_Kqueue) {
- set<EventableDescriptor*>::iterator i =
ModifiedDescriptors.begin();
+ std::set<EventableDescriptor*>::iterator i =
ModifiedDescriptors.begin();
while (i != ModifiedDescriptors.end()) {
assert (*i);
if ((*i)->GetKqueueArmWrite())
@@ -2129,7 +2120,7 @@
throw std::runtime_error(errbuf);
}
Bindable_t* b = new Bindable_t();
- Pids.insert(make_pair (pid, b));
+ Pids.insert(std::make_pair (pid, b));
return b->GetBinding();
}
@@ -2166,7 +2157,7 @@
void EventMachine_t::UnwatchPid (const uintptr_t sig)
{
- for(map<int, Bindable_t*>::iterator i=Pids.begin(); i != Pids.end();
i++)
+ for(std::map<int, Bindable_t*>::iterator i=Pids.begin(); i !=
Pids.end(); i++)
{
if (i->second->GetBinding() == sig) {
UnwatchPid (i->first);
@@ -2228,7 +2219,7 @@
if (wd != -1) {
Bindable_t* b = new Bindable_t();
- Files.insert(make_pair (wd, b));
+ Files.insert(std::make_pair (wd, b));
return b->GetBinding();
}
@@ -2262,7 +2253,7 @@
void EventMachine_t::UnwatchFile (const uintptr_t sig)
{
- for(map<int, Bindable_t*>::iterator i=Files.begin(); i != Files.end();
i++)
+ for(std::map<int, Bindable_t*>::iterator i=Files.begin(); i !=
Files.end(); i++)
{
if (i->second->GetBinding() == sig) {
UnwatchFile (i->first);
@@ -2293,7 +2284,7 @@
int current = 0;
while (current < returned) {
struct inotify_event* event = (struct
inotify_event*)(buffer+current);
- map<int, Bindable_t*>::const_iterator bindable =
Files.find(event->wd);
+ std::map<int, Bindable_t*>::const_iterator bindable =
Files.find(event->wd);
if (bindable != Files.end()) {
if (event->mask & (IN_MODIFY | IN_CREATE |
IN_DELETE | IN_MOVE)){
(*EventCallback)(bindable->second->GetBinding(), EM_CONNECTION_READ,
"modified", 8);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/em.h new/ext/em.h
--- old/ext/em.h 2017-07-28 08:45:28.000000000 +0200
+++ new/ext/em.h 2018-05-12 14:24:09.000000000 +0200
@@ -236,14 +236,13 @@
class Timer_t: public Bindable_t {
};
- multimap<uint64_t, Timer_t> Timers;
- multimap<uint64_t, EventableDescriptor*> Heartbeats;
- map<int, Bindable_t*> Files;
- map<int, Bindable_t*> Pids;
- vector<EventableDescriptor*> Descriptors;
- vector<EventableDescriptor*> NewDescriptors;
- vector<EventableDescriptor*> DescriptorsToDelete;
- set<EventableDescriptor*> ModifiedDescriptors;
+ std::multimap<uint64_t, Timer_t> Timers;
+ std::multimap<uint64_t, EventableDescriptor*> Heartbeats;
+ std::map<int, Bindable_t*> Files;
+ std::map<int, Bindable_t*> Pids;
+ std::vector<EventableDescriptor*> Descriptors;
+ std::vector<EventableDescriptor*> NewDescriptors;
+ std::set<EventableDescriptor*> ModifiedDescriptors;
SOCKET LoopBreakerReader;
SOCKET LoopBreakerWriter;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/fastfilereader/mapper.cpp
new/ext/fastfilereader/mapper.cpp
--- old/ext/fastfilereader/mapper.cpp 2017-07-28 08:45:28.000000000 +0200
+++ new/ext/fastfilereader/mapper.cpp 2018-05-12 14:24:09.000000000 +0200
@@ -30,13 +30,12 @@
#include <sys/mman.h>
#include <fcntl.h>
#include <errno.h>
+#include <unistd.h>
#include <iostream>
-#include "unistd.h"
#include <string>
#include <cstring>
#include <stdexcept>
-using namespace std;
#include "mapper.h"
@@ -44,7 +43,7 @@
Mapper_t::Mapper_t
******************/
-Mapper_t::Mapper_t (const string &filename)
+Mapper_t::Mapper_t (const std::string &filename)
{
/* We ASSUME we can open the file.
* (More precisely, we assume someone else checked before we got here.)
@@ -52,11 +51,11 @@
Fd = open (filename.c_str(), O_RDONLY);
if (Fd < 0)
- throw runtime_error (strerror (errno));
+ throw std::runtime_error (strerror (errno));
struct stat st;
if (fstat (Fd, &st))
- throw runtime_error (strerror (errno));
+ throw std::runtime_error (strerror (errno));
FileSize = st.st_size;
#ifdef OS_WIN32
@@ -65,7 +64,7 @@
MapPoint = (const char*) mmap (0, FileSize, PROT_READ, MAP_SHARED, Fd,
0);
#endif
if (MapPoint == MAP_FAILED)
- throw runtime_error (strerror (errno));
+ throw std::runtime_error (strerror (errno));
}
@@ -128,7 +127,6 @@
#include <iostream>
#include <string>
#include <stdexcept>
-using namespace std;
#include "mapper.h"
@@ -136,7 +134,7 @@
Mapper_t::Mapper_t
******************/
-Mapper_t::Mapper_t (const string &filename)
+Mapper_t::Mapper_t (const std::string &filename)
{
/* We ASSUME we can open the file.
* (More precisely, we assume someone else checked before we got here.)
@@ -150,7 +148,7 @@
hFile = CreateFile (filename.c_str(), GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
- throw runtime_error ("File not found");
+ throw std::runtime_error ("File not found");
BY_HANDLE_FILE_INFORMATION i;
if (GetFileInformationByHandle (hFile, &i))
@@ -158,7 +156,7 @@
hMapping = CreateFileMapping (hFile, NULL, PAGE_READWRITE, 0, 0, NULL);
if (!hMapping)
- throw runtime_error ("File not mapped");
+ throw std::runtime_error ("File not mapped");
#ifdef OS_WIN32
MapPoint = (char*) MapViewOfFile (hMapping, FILE_MAP_WRITE, 0, 0, 0);
@@ -166,7 +164,7 @@
MapPoint = (const char*) MapViewOfFile (hMapping, FILE_MAP_WRITE, 0, 0,
0);
#endif
if (!MapPoint)
- throw runtime_error ("Mappoint not read");
+ throw std::runtime_error ("Mappoint not read");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/fastfilereader/mapper.h
new/ext/fastfilereader/mapper.h
--- old/ext/fastfilereader/mapper.h 2017-07-28 08:45:28.000000000 +0200
+++ new/ext/fastfilereader/mapper.h 2018-05-12 14:24:09.000000000 +0200
@@ -29,7 +29,7 @@
class Mapper_t
{
public:
- Mapper_t (const string&);
+ Mapper_t (const std::string&);
virtual ~Mapper_t();
const char *GetChunk (unsigned);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/fastfilereader/rubymain.cpp
new/ext/fastfilereader/rubymain.cpp
--- old/ext/fastfilereader/rubymain.cpp 2017-07-28 08:45:29.000000000 +0200
+++ new/ext/fastfilereader/rubymain.cpp 2018-05-12 14:24:09.000000000 +0200
@@ -21,7 +21,6 @@
#include <iostream>
#include <stdexcept>
-using namespace std;
#include <ruby.h>
#include "mapper.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/page.cpp new/ext/page.cpp
--- old/ext/page.cpp 2017-07-28 08:45:29.000000000 +0200
+++ new/ext/page.cpp 2018-05-12 14:24:09.000000000 +0200
@@ -95,7 +95,7 @@
if (buf && (size > 0)) {
char *copy = (char*) malloc (size);
if (!copy)
- throw runtime_error ("no memory in pagelist");
+ throw std::runtime_error ("no memory in pagelist");
memcpy (copy, buf, size);
Pages.push_back (Page (copy, size));
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/page.h new/ext/page.h
--- old/ext/page.h 2017-07-28 08:45:29.000000000 +0200
+++ new/ext/page.h 2018-05-12 14:24:09.000000000 +0200
@@ -44,7 +44,7 @@
void PopFront();
private:
- deque<Page> Pages;
+ std::deque<Page> Pages;
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/project.h new/ext/project.h
--- old/ext/project.h 2017-07-28 08:45:29.000000000 +0200
+++ new/ext/project.h 2018-05-12 14:24:09.000000000 +0200
@@ -115,8 +115,6 @@
#include <stdint.h>
#endif
-using namespace std;
-
#ifdef WITH_SSL
#include <openssl/ssl.h>
#include <openssl/err.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/ssl.cpp new/ext/ssl.cpp
--- old/ext/ssl.cpp 2017-07-28 08:45:29.000000000 +0200
+++ new/ext/ssl.cpp 2018-05-12 14:24:09.000000000 +0200
@@ -120,7 +120,7 @@
SslContext_t::SslContext_t
**************************/
-SslContext_t::SslContext_t (bool is_server, const string &privkeyfile, const
string &certchainfile, const string &cipherlist, const string &ecdh_curve,
const string &dhparam, int ssl_version) :
+SslContext_t::SslContext_t (bool is_server, const std::string &privkeyfile,
const std::string &certchainfile, const std::string &cipherlist, const
std::string &ecdh_curve, const std::string &dhparam, int ssl_version) :
bIsServer (is_server),
pCtx (NULL),
PrivateKey (NULL),
@@ -219,7 +219,7 @@
BIO_free(bio);
char buf [500];
snprintf (buf, sizeof(buf)-1, "dhparam:
PEM_read_bio_DHparams(%s) failed", dhparam.c_str());
- throw new std::runtime_error(buf);
+ throw std::runtime_error (buf);
}
SSL_CTX_set_tmp_dh(pCtx, dh);
@@ -304,7 +304,7 @@
SslBox_t::SslBox_t
******************/
-SslBox_t::SslBox_t (bool is_server, const string &privkeyfile, const string
&certchainfile, bool verify_peer, bool fail_if_no_peer_cert, const string
&snihostname, const string &cipherlist, const string &ecdh_curve, const string
&dhparam, int ssl_version, const uintptr_t binding):
+SslBox_t::SslBox_t (bool is_server, const std::string &privkeyfile, const
std::string &certchainfile, bool verify_peer, bool fail_if_no_peer_cert, const
std::string &snihostname, const std::string &cipherlist, const std::string
&ecdh_curve, const std::string &dhparam, int ssl_version, const uintptr_t
binding):
bIsServer (is_server),
bHandshakeCompleted (false),
bVerifyPeer (verify_peer),
@@ -345,8 +345,11 @@
SSL_set_verify(pSSL, mode, ssl_verify_wrapper);
}
- if (!bIsServer)
- SSL_connect (pSSL);
+ if (!bIsServer) {
+ int e = SSL_connect (pSSL);
+ if (e != 1)
+ ERR_print_errors_fp(stderr);
+ }
}
@@ -397,6 +400,7 @@
if (e != 1) {
int er = SSL_get_error (pSSL, e);
if (er != SSL_ERROR_WANT_READ) {
+ ERR_print_errors_fp(stderr);
// Return -1 for a nonfatal error, -2 for an
error that should force the connection down.
return (er == SSL_ERROR_SSL) ? (-2) : (-1);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/ssl.h new/ext/ssl.h
--- old/ext/ssl.h 2017-07-28 08:45:29.000000000 +0200
+++ new/ext/ssl.h 2018-05-12 14:24:09.000000000 +0200
@@ -33,7 +33,7 @@
class SslContext_t
{
public:
- SslContext_t (bool is_server, const string &privkeyfile, const
string &certchainfile, const string &cipherlist, const string &ecdh_curve,
const string &dhparam, int ssl_version);
+ SslContext_t (bool is_server, const std::string &privkeyfile,
const std::string &certchainfile, const std::string &cipherlist, const
std::string &ecdh_curve, const std::string &dhparam, int ssl_version);
virtual ~SslContext_t();
private:
@@ -61,7 +61,7 @@
class SslBox_t
{
public:
- SslBox_t (bool is_server, const string &privkeyfile, const
string &certchainfile, bool verify_peer, bool fail_if_no_peer_cert, const
string &snihostname, const string &cipherlist, const string &ecdh_curve, const
string &dhparam, int ssl_version, const uintptr_t binding);
+ SslBox_t (bool is_server, const std::string &privkeyfile, const
std::string &certchainfile, bool verify_peer, bool fail_if_no_peer_cert, const
std::string &snihostname, const std::string &cipherlist, const std::string
&ecdh_curve, const std::string &dhparam, int ssl_version, const uintptr_t
binding);
virtual ~SslBox_t();
int PutPlaintext (const char*, int);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/em/pure_ruby.rb new/lib/em/pure_ruby.rb
--- old/lib/em/pure_ruby.rb 2017-07-28 08:45:29.000000000 +0200
+++ new/lib/em/pure_ruby.rb 2018-05-12 14:24:09.000000000 +0200
@@ -430,6 +430,11 @@
# Needs to be implemented. Currently a no-op stub to allow
# certain software to operate with the EM pure-ruby.
end
+
+ # @private
+ def report_connection_error_status signature
+ get_sock_opt(signature, Socket::SOL_SOCKET, Socket::SO_ERROR).int
+ end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/em/version.rb new/lib/em/version.rb
--- old/lib/em/version.rb 2017-07-28 08:45:29.000000000 +0200
+++ new/lib/em/version.rb 2018-05-12 14:24:09.000000000 +0200
@@ -1,3 +1,3 @@
module EventMachine
- VERSION = "1.2.5"
+ VERSION = "1.2.7"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/eventmachine.rb new/lib/eventmachine.rb
--- old/lib/eventmachine.rb 2017-07-28 08:45:29.000000000 +0200
+++ new/lib/eventmachine.rb 2018-05-12 14:24:09.000000000 +0200
@@ -177,14 +177,15 @@
@next_tick_queue ||= []
@tails ||= []
begin
+ initialize_event_machine
@reactor_pid = Process.pid
+ @reactor_thread = Thread.current
@reactor_running = true
- initialize_event_machine
+
(b = blk || block) and add_timer(0, b)
if @next_tick_queue && !@next_tick_queue.empty?
add_timer(0) { signal_loopbreak }
end
- @reactor_thread = Thread.current
# Rubinius needs to come back into "Ruby space" for GC to work,
# so we'll crank the machine here.
@@ -984,7 +985,7 @@
# do some work during the next_tick. The only mechanism we have from
the
# ruby side is next_tick itself, although ideally, we'd just drop a
byte
# on the loopback descriptor.
- EM.next_tick {} if exception_raised
+ next_tick {} if exception_raised
end
end
end
@@ -1079,7 +1080,7 @@
raise error unless eback
@resultqueue << [error, eback]
end
- EventMachine.signal_loopbreak
+ signal_loopbreak
end
end
@threadpool << thread
@@ -1490,12 +1491,22 @@
rescue Errno::EBADF, IOError
end
end
- rescue Exception => e
- if stopping?
- @wrapped_exception = $!
- stop
+ # As noted above, unbind absolutely must not raise an exception or the
reactor will crash.
+ # If there is no EM.error_handler, or if the error_handler retrows,
then stop the reactor,
+ # stash the exception in $wrapped_exception, and the exception will be
raised after the
+ # reactor is cleaned up (see the last line of self.run).
+ rescue Exception => error
+ if instance_variable_defined? :@error_handler
+ begin
+ @error_handler.call error
+ # No need to stop unless error_handler rethrows
+ rescue Exception => error
+ @wrapped_exception = error
+ stop
+ end
else
- raise e
+ @wrapped_exception = error
+ stop
end
end
elsif c = @acceptors.delete( conn_binding )
@@ -1503,7 +1514,7 @@
else
if $! # Bubble user generated errors.
@wrapped_exception = $!
- EM.stop
+ stop
else
raise ConnectionNotBound, "received ConnectionUnbound for an unknown
signature: #{conn_binding}"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/jeventmachine.rb new/lib/jeventmachine.rb
--- old/lib/jeventmachine.rb 2017-07-28 08:45:29.000000000 +0200
+++ new/lib/jeventmachine.rb 2018-05-12 14:24:09.000000000 +0200
@@ -80,6 +80,17 @@
# @private
SslVerify = 109
+ # @private
+ EM_PROTO_SSLv2 = 2
+ # @private
+ EM_PROTO_SSLv3 = 4
+ # @private
+ EM_PROTO_TLSv1 = 8
+ # @private
+ EM_PROTO_TLSv1_1 = 16
+ # @private
+ EM_PROTO_TLSv1_2 = 32
+
# Exceptions that are defined in rubymain.cpp
class ConnectionError < RuntimeError; end
class ConnectionNotBound < RuntimeError; end
@@ -127,6 +138,8 @@
end
def self.send_data sig, data, length
@em.sendData sig, data.to_java_bytes
+ rescue java.lang.NullPointerException
+ 0
end
def self.send_datagram sig, data, length, address, port
@em.sendDatagram sig, data.to_java_bytes, length, address, port
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2017-07-28 08:45:28.000000000 +0200
+++ new/metadata 2018-05-12 14:24:09.000000000 +0200
@@ -1,53 +1,53 @@
--- !ruby/object:Gem::Specification
name: eventmachine
version: !ruby/object:Gem::Version
- version: 1.2.5
+ version: 1.2.7
platform: ruby
authors:
- Francis Cianfrocca
- Aman Gupta
-autorequire:
+autorequire:
bindir: bin
cert_chain: []
-date: 2017-07-28 00:00:00.000000000 Z
+date: 2018-05-12 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
+ name: test-unit
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
version: '2.0'
- name: test-unit
- prerelease: false
type: :development
+ prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
version: '2.0'
- !ruby/object:Gem::Dependency
+ name: rake-compiler
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
version: 0.9.5
- name: rake-compiler
- prerelease: false
type: :development
+ prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
version: 0.9.5
- !ruby/object:Gem::Dependency
+ name: rake-compiler-dock
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
version: 0.5.1
- name: rake-compiler-dock
- prerelease: false
type: :development
+ prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
@@ -262,7 +262,7 @@
- Ruby
- GPL-2.0
metadata: {}
-post_install_message:
+post_install_message:
rdoc_options:
- "--title"
- EventMachine
@@ -285,9 +285,9 @@
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubyforge_project:
-rubygems_version: 2.6.8
-signing_key:
+rubyforge_project:
+rubygems_version: 2.5.2
+signing_key:
specification_version: 4
summary: Ruby/EventMachine library
test_files:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/test_basic.rb new/tests/test_basic.rb
--- old/tests/test_basic.rb 2017-07-28 08:45:29.000000000 +0200
+++ new/tests/test_basic.rb 2018-05-12 14:24:09.000000000 +0200
@@ -113,6 +113,9 @@
EM.start_server "127.0.0.1", @port
EM.connect "127.0.0.1", @port, UnbindError
}
+
+ # Remove the error handler before the next test
+ EM.error_handler(nil)
end
module BrsTestSrv
@@ -309,6 +312,9 @@
EM.add_timer(0.001) { EM.stop }
end
+ # Remove the error handler before the next test
+ EM.error_handler(nil)
+
assert_equal 1, errors.size
assert_equal [:first, :second], ticks
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/test_ipv6.rb new/tests/test_ipv6.rb
--- old/tests/test_ipv6.rb 2017-07-28 08:45:29.000000000 +0200
+++ new/tests/test_ipv6.rb 2018-05-12 14:24:09.000000000 +0200
@@ -41,7 +41,7 @@
EM.run do
EM.open_datagram_socket(@@public_ipv6, @local_port) do |s|
def s.receive_data data
- _port, @@remote_ip = Socket.unpack_sockaddr_in(s.get_peername)
+ _port, @@remote_ip = Socket.unpack_sockaddr_in(get_peername)
@@received_data = data
EM.stop
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/test_pool.rb new/tests/test_pool.rb
--- old/tests/test_pool.rb 2017-07-28 08:45:29.000000000 +0200
+++ new/tests/test_pool.rb 2018-05-12 14:24:09.000000000 +0200
@@ -56,7 +56,7 @@
assert_equal pooled_res, pooled_res2
end
- def test_supports_custom_error_handler
+ def test_supports_custom_on_error
eres = nil
pool.on_error do |res|
eres = res