iodine 0.7.21 → 0.7.22

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
  SHA256:
3
- metadata.gz: b0f9360224da57145ba3ed9e81d5e5472cf9bb9732c9d36fab6e22c32428013a
4
- data.tar.gz: e04fc9d016bbb53cf80d810765a5b934d0d996d447faadd6451c27612cd17da6
3
+ metadata.gz: 8932b4e432bde801ae72ddb5a757e178a3fa2ca061527521c2b941d964be8920
4
+ data.tar.gz: a6d6c4056060ad82e0b735aa6ebf067cbde0f5a6bda6d9a16fea1c62ba7b14df
5
5
  SHA512:
6
- metadata.gz: 970307f1349dd8ca00a6caa6bfb59c6485f05fdb0b1654dd2788f3b477f628aa9b1c24a9df0873409930dd071dc446e999164731892fe7d70a64983f49a72d99
7
- data.tar.gz: aa2417372b97f415ee83edd7aa0ecd557cef4144eba546cd931bc36078574cc03b574f16a395a779957015084c1737b996d13337516ac474efa78d4140075035
6
+ metadata.gz: e3d3bef35a9ca6707ab14105ec5a6c6bab88cb23666be74892f6d56c3ae829a21d3bd03fee40096d891b6db147f1c1935b3c379c4e93192d15f18094e2da1760
7
+ data.tar.gz: f50bd45abd3d7cecb8156912168ee265936c1a39e51d378c70ceffeab4d0c884cf8959611a1fcbeb03146b1460ec874b7164d57b636dedae5b1f505fe49b88b1
@@ -6,6 +6,10 @@ Please notice that this change log contains changes for upcoming releases as wel
6
6
 
7
7
  ## Changes:
8
8
 
9
+ #### Change log v.0.7.22
10
+
11
+ **Fix**: (`fio`, `redis`) fixed IPC messages between redis connections (in the master process) and callback blocks (executed in the worker processes). Credit to @moxgeek (Marouane Elmidaoui) for exposing this issue (plezi#31).
12
+
9
13
  #### Change log v.0.7.21
10
14
 
11
15
  **Fix**: (`iodine`, `redis`) Redis response was attempting to create Ruby objects outside the GIL. This is now fixed by entering the GIL earlier (before objects are created). Credit to @moxgeek (Marouane Elmidaoui) for exposing this issue (plezi#31).
data/README.md CHANGED
@@ -64,6 +64,12 @@ Then start your application from the command-line / terminal using iodine:
64
64
  bundler exec iodine
65
65
  ```
66
66
 
67
+ **KNOWN ISSUE:** the installation script tests for OpenSSL 1.1.0 and above. However, this testing approach sometimes provides false positives. If TLS isn't required, install with `NO_SSL=1`. i.e.:
68
+
69
+ ```bash
70
+ NO_SSL=1 bundler exec iodine
71
+ ```
72
+
67
73
  ### Running with Rails
68
74
 
69
75
  On Rails:
@@ -77,8 +83,8 @@ On Rails:
77
83
  ```ruby
78
84
  # Iodine setup - use conditional setup to allow command-line arguments to override these:
79
85
  if(defined?(Iodine))
80
- Iodine.threads = ENV.fetch("RAILS_MAX_THREADS") { 5 } if Iodine.threads.zero?
81
- Iodine.workers = ENV.fetch("WEB_CONCURRENCY") { 2 } if Iodine.workers.zero?
86
+ Iodine.threads = ENV.fetch("RAILS_MAX_THREADS", 5).to_i if Iodine.threads.zero?
87
+ Iodine.workers = ENV.fetch("WEB_CONCURRENCY", 2).to_i if Iodine.workers.zero?
82
88
  Iodine::DEFAULT_SETTINGS[:port] = ENV.fetch("PORT") if ENV.fetch("PORT")
83
89
  end
84
90
  ```
@@ -3876,14 +3876,23 @@ inline FIO_FUNC fio_str_info_s fio_str_resize(fio_str_s *s, size_t size) {
3876
3876
  if (!s || s->frozen) {
3877
3877
  return fio_str_info(s);
3878
3878
  }
3879
- fio_str_capa_assert(s, size);
3880
3879
  if (s->small || !s->data) {
3880
+ if (size >= FIO_STR_SMALL_CAPA) {
3881
+ s->small = (uint8_t)(((FIO_STR_SMALL_CAPA << 1) | 1) & 0xFF);
3882
+ fio_str_capa_assert(s, size);
3883
+ goto big;
3884
+ }
3881
3885
  s->small = (uint8_t)(((size << 1) | 1) & 0xFF);
3882
3886
  FIO_STR_SMALL_DATA(s)[size] = 0;
3883
3887
  return (fio_str_info_s){.capa = (FIO_STR_SMALL_CAPA - 1),
3884
3888
  .len = size,
3885
3889
  .data = FIO_STR_SMALL_DATA(s)};
3886
3890
  }
3891
+ if (size >= s->capa) {
3892
+ s->len = s->capa;
3893
+ fio_str_capa_assert(s, size);
3894
+ }
3895
+ big:
3887
3896
  s->len = size;
3888
3897
  s->data[size] = 0;
3889
3898
  return (fio_str_info_s){.capa = s->capa, .len = size, .data = s->data};
@@ -189,7 +189,7 @@ static void write_safe_str(FIOBJ dest, const FIOBJ str) {
189
189
  }
190
190
  while (len) {
191
191
  char *restrict writer = (char *)t.data;
192
- while (len && (src[0] > 32 && src[0] != '"' && src[0] != '\\')) {
192
+ while (len && src[0] > 32 && src[0] != '"' && src[0] != '\\') {
193
193
  len--;
194
194
  writer[end++] = *(src++);
195
195
  }
@@ -245,13 +245,11 @@ static void write_safe_str(FIOBJ dest, const FIOBJ str) {
245
245
  src++;
246
246
  len--;
247
247
  if (added >= 48 && capa <= end + len + 64) {
248
- if (0) {
249
- capa = (((capa >> 12) + 1) << 12) - 1;
250
- capa = fiobj_str_capa_assert(dest, capa);
251
- } else {
252
- capa = fiobj_str_capa_assert(dest, (end + len + 64));
253
- }
248
+ writer[end] = 0;
249
+ fiobj_str_resize(dest, (end + len + 64));
254
250
  t = fiobj_obj2cstr(dest);
251
+ writer = (char *)t.data;
252
+ capa = t.capa;
255
253
  added = 0;
256
254
  }
257
255
  }
@@ -72,9 +72,9 @@ typedef struct {
72
72
  static inline void redis_internal_reset(struct redis_engine_internal_s *i) {
73
73
  i->buf_pos = 0;
74
74
  i->parser = (resp_parser_s){.obj_countdown = 0, .expecting = 0};
75
- fiobj_free(i->str);
75
+ fiobj_free((FIOBJ)fio_ct_if(i->ary == FIOBJ_INVALID, (uintptr_t)i->str,
76
+ (uintptr_t)i->ary));
76
77
  i->str = FIOBJ_INVALID;
77
- fiobj_free(i->ary);
78
78
  i->ary = FIOBJ_INVALID;
79
79
  i->ary_count = 0;
80
80
  i->nesting = 0;
@@ -106,9 +106,7 @@ static inline void redis_free(redis_engine_s *r) {
106
106
  Simple RESP formatting
107
107
  ***************************************************************************** */
108
108
 
109
- inline static void fiobj2resp2(FIOBJ dest, FIOBJ obj) {
110
- if (fiobj_hash_key_in_loop())
111
- fiobj2resp2(dest, fiobj_hash_key_in_loop());
109
+ inline static void fiobj2resp___internal(FIOBJ dest, FIOBJ obj) {
112
110
  fio_str_info_s s;
113
111
  switch (FIOBJ_TYPE(obj)) {
114
112
  case FIOBJ_T_NULL:
@@ -155,7 +153,9 @@ inline static void fiobj2resp2(FIOBJ dest, FIOBJ obj) {
155
153
  }
156
154
 
157
155
  static int fiobj2resp_task(FIOBJ o, void *dest_) {
158
- fiobj2resp2((FIOBJ)dest_, o);
156
+ if (fiobj_hash_key_in_loop())
157
+ fiobj2resp___internal((FIOBJ)dest_, fiobj_hash_key_in_loop());
158
+ fiobj2resp___internal((FIOBJ)dest_, o);
159
159
  return 0;
160
160
  }
161
161
 
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = '0.7.21'.freeze
2
+ VERSION = '0.7.22'.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.7.21
4
+ version: 0.7.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-01 00:00:00.000000000 Z
11
+ date: 2019-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -220,7 +220,7 @@ licenses:
220
220
  - MIT
221
221
  metadata:
222
222
  allowed_push_host: https://rubygems.org
223
- post_install_message: 'Thank you for installing Iodine 0.7.21.
223
+ post_install_message: 'Thank you for installing Iodine 0.7.22.
224
224
 
225
225
  '
226
226
  rdoc_options: []