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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aca722c23efafe6e1253f5ab4f9cea5157ded7eb
4
- data.tar.gz: 3cd0891b931b59d0474a8dc0f4acdb67a1775923
3
+ metadata.gz: 8110abd50ee8b728afb0b0bba32010636acae150
4
+ data.tar.gz: ccc3e4a8e25014e15bae41aadc343aa04c596586
5
5
  SHA512:
6
- metadata.gz: fe7c754d170ec52fe96b77bcd2b18a79586e5d3cd6db4bff5f3ba834e32060b470fb3c5fce9799a9868af7cb832143d396ccc1216691f0a3a17887b06124b72a
7
- data.tar.gz: '09be0eccb8cf2a065be75bb2ae96c4e4cc9ea79fc29a7864d122d59aa743ec709551fd345dbb6a79f0910685fc061edc8dee1e1c33649cd2992e931e0654eef4'
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 = (EPOLLOUT | EPOLLIN | EPOLLET |
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
- return epoll_ctl(evio_fd, EPOLL_CTL_ADD, fd, &chevent);
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) < 0)
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
- else if (fd != -1)
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
  /**
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = '0.4.12'.freeze
2
+ VERSION = '0.4.14'.freeze
3
3
  end
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.12
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-24 00:00:00.000000000 Z
11
+ date: 2017-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack