iodine 0.4.12 → 0.4.14
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of iodine might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/ext/iodine/evio.c +6 -5
- data/ext/iodine/facil.c +12 -4
- data/ext/iodine/pubsub.h +10 -2
- data/lib/iodine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8110abd50ee8b728afb0b0bba32010636acae150
|
4
|
+
data.tar.gz: ccc3e4a8e25014e15bae41aadc343aa04c596586
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73e41e508c1b66928402ff515890394ddf36b62bbc11c309d924306310ed72ff67d3c0e0f0562f97ee22b235a71a91d32ff2a46e2c7e839ec4f60b2f2a1431b4
|
7
|
+
data.tar.gz: 34415df07c8f045a4f287334e012d9678bb1ad44e8355872183ee06df01e0fcbd7a5c17bba5f8648fbf0bf86762f2c6cc67cd7b3fbe060a4318d0679f6f87a30
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,14 @@ Please notice that this change log contains changes for upcoming releases as wel
|
|
6
6
|
|
7
7
|
## Changes:
|
8
8
|
|
9
|
+
#### Next
|
10
|
+
|
11
|
+
**Fix**: (`facil.io`) fixes an issue where timer monitoring would report failure when the timer exists and is being monitored.
|
12
|
+
|
13
|
+
#### Change log v.0.4.12
|
14
|
+
|
15
|
+
**Fix**: (`facil.io`) fixes some lingering issues with the new Websocket parser, namely an issue where certain network packet lengths would cause the parser to fail. Credit to Tom Lahti (@uidzip) for exposing the issue.
|
16
|
+
|
9
17
|
#### Change log v.0.4.11
|
10
18
|
|
11
19
|
**Fix**: (`iodine`) use Ruby `fork` instead of system `fork`, allowing Ruby hooks to run before and after forking. This also fixes an issue where the Ruby timer thread isn't (re)initialized.
|
data/ext/iodine/evio.c
CHANGED
@@ -94,8 +94,7 @@ Adds a file descriptor to the polling object.
|
|
94
94
|
int evio_add(int fd, void *callback_arg) {
|
95
95
|
struct epoll_event chevent = {0};
|
96
96
|
chevent.data.ptr = (void *)callback_arg;
|
97
|
-
chevent.events =
|
98
|
-
EPOLLOUT | EPOLLIN | EPOLLET | EPOLLERR | EPOLLRDHUP | EPOLLHUP;
|
97
|
+
chevent.events = EPOLLOUT | EPOLLIN | EPOLLET | EPOLLRDHUP | EPOLLHUP;
|
99
98
|
return epoll_ctl(evio_fd, EPOLL_CTL_ADD, fd, &chevent);
|
100
99
|
}
|
101
100
|
|
@@ -135,8 +134,7 @@ Adds a timer file descriptor, so that callbacks will be called for it's events.
|
|
135
134
|
intptr_t evio_add_timer(int fd, void *callback_arg,
|
136
135
|
unsigned long milliseconds) {
|
137
136
|
struct epoll_event chevent = {.data.ptr = (void *)callback_arg,
|
138
|
-
.events = (
|
139
|
-
EPOLLERR | EPOLLRDHUP | EPOLLHUP)};
|
137
|
+
.events = (EPOLLIN | EPOLLET)};
|
140
138
|
struct itimerspec new_t_data;
|
141
139
|
new_t_data.it_value.tv_sec = new_t_data.it_interval.tv_sec =
|
142
140
|
milliseconds / 1000;
|
@@ -144,7 +142,10 @@ intptr_t evio_add_timer(int fd, void *callback_arg,
|
|
144
142
|
(milliseconds % 1000) * 1000000;
|
145
143
|
if (timerfd_settime(fd, 0, &new_t_data, NULL) == -1)
|
146
144
|
return -1;
|
147
|
-
|
145
|
+
int ret = epoll_ctl(evio_fd, EPOLL_CTL_ADD, fd, &chevent);
|
146
|
+
if (ret == -1 && errno == EEXIST)
|
147
|
+
return 0;
|
148
|
+
return ret;
|
148
149
|
}
|
149
150
|
|
150
151
|
/** Rearms the timer. Required only by `epoll`.*/
|
data/ext/iodine/facil.c
CHANGED
@@ -641,17 +641,25 @@ int facil_run_every(size_t milliseconds, size_t repetitions,
|
|
641
641
|
if (protocol == NULL)
|
642
642
|
goto error;
|
643
643
|
facil_attach(uuid, (protocol_s *)protocol);
|
644
|
-
if (evio_isactive() && evio_add_timer(fd, (void *)uuid, milliseconds)
|
644
|
+
if (evio_isactive() && evio_add_timer(fd, (void *)uuid, milliseconds) == -1)
|
645
645
|
goto error;
|
646
646
|
return 0;
|
647
647
|
error:
|
648
|
-
if (uuid != -1)
|
648
|
+
if (uuid != -1) {
|
649
|
+
const int old = errno;
|
649
650
|
sock_close(uuid);
|
650
|
-
|
651
|
+
errno = old;
|
652
|
+
} else if (fd != -1) {
|
653
|
+
const int old = errno;
|
651
654
|
close(fd);
|
655
|
+
errno = old;
|
656
|
+
}
|
652
657
|
error_fin:
|
653
|
-
if (on_finish)
|
658
|
+
if (on_finish) {
|
659
|
+
const int old = errno;
|
654
660
|
on_finish(arg);
|
661
|
+
errno = old;
|
662
|
+
}
|
655
663
|
return -1;
|
656
664
|
}
|
657
665
|
|
data/ext/iodine/pubsub.h
CHANGED
@@ -189,13 +189,21 @@ struct pubsub_engine_s {
|
|
189
189
|
unsigned push2cluster : 1;
|
190
190
|
};
|
191
191
|
|
192
|
-
/** The default pub/sub engine.
|
192
|
+
/** The default pub/sub engine.
|
193
|
+
* This engine performs pub/sub within a group of processes (process cluster).
|
194
|
+
*
|
195
|
+
* The process cluser is initialized by the `facil_run` command with `processes`
|
196
|
+
* set to more than 1.
|
197
|
+
*/
|
193
198
|
extern const pubsub_engine_s *PUBSUB_CLUSTER_ENGINE;
|
194
199
|
|
195
200
|
/** An engine that performs pub/sub only within a single process. */
|
196
201
|
extern const pubsub_engine_s *PUBSUB_PROCESS_ENGINE;
|
197
202
|
|
198
|
-
/** Allows process wide changes to the default Pub/Sub Engine.
|
203
|
+
/** Allows process wide changes to the default Pub/Sub Engine.
|
204
|
+
* Setting a new default before calling `facil_run` will change the default for
|
205
|
+
* the whole process cluster.
|
206
|
+
*/
|
199
207
|
extern const pubsub_engine_s *PUBSUB_DEFAULT_ENGINE;
|
200
208
|
|
201
209
|
/**
|
data/lib/iodine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iodine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|