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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +8 -2
- data/ext/iodine/fio.h +10 -1
- data/ext/iodine/fiobj_json.c +5 -7
- data/ext/iodine/redis_engine.c +6 -6
- data/lib/iodine/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8932b4e432bde801ae72ddb5a757e178a3fa2ca061527521c2b941d964be8920
|
4
|
+
data.tar.gz: a6d6c4056060ad82e0b735aa6ebf067cbde0f5a6bda6d9a16fea1c62ba7b14df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3d3bef35a9ca6707ab14105ec5a6c6bab88cb23666be74892f6d56c3ae829a21d3bd03fee40096d891b6db147f1c1935b3c379c4e93192d15f18094e2da1760
|
7
|
+
data.tar.gz: f50bd45abd3d7cecb8156912168ee265936c1a39e51d378c70ceffeab4d0c884cf8959611a1fcbeb03146b1460ec874b7164d57b636dedae5b1f505fe49b88b1
|
data/CHANGELOG.md
CHANGED
@@ -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"
|
81
|
-
Iodine.workers = ENV.fetch("WEB_CONCURRENCY"
|
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
|
```
|
data/ext/iodine/fio.h
CHANGED
@@ -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};
|
data/ext/iodine/fiobj_json.c
CHANGED
@@ -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 &&
|
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
|
-
|
249
|
-
|
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
|
}
|
data/ext/iodine/redis_engine.c
CHANGED
@@ -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
|
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
|
-
|
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
|
|
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.7.
|
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-
|
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.
|
223
|
+
post_install_message: 'Thank you for installing Iodine 0.7.22.
|
224
224
|
|
225
225
|
'
|
226
226
|
rdoc_options: []
|