iodine 0.6.2 → 0.6.3
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 +6 -0
- data/ext/iodine/iodine_connection.c +13 -5
- data/ext/iodine/iodine_connection.h +1 -1
- data/ext/iodine/iodine_http.c +1 -1
- data/ext/iodine/iodine_pubsub.c +1 -1
- 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: 2f20b276e0e954dffafad0952b0bc11d306dc521b83ffe31fada885e1218c7b4
|
4
|
+
data.tar.gz: 1c6bd56184c5f53a0b25e5cbe1863098063887a5bc158477ce4028e441a6e19b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c88074a686c61146cb6d6aabbbf293c978b5b37bb031daf69aa6ac597922655a49f7f3bfb0750ff59041b5129e8206ded38bd20caa3af411150cfd102777eb5
|
7
|
+
data.tar.gz: 5cc6299db78e362b668b7eaa9f481fd7d76bd5efdbb4e4ad0f232f5c882589e2e9897d5881f05185ef399e09b6cf3add7fca960a9c8186283224b9757fb664d7
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,12 @@ Please notice that this change log contains changes for upcoming releases as wel
|
|
8
8
|
|
9
9
|
#### Change log v.0.6.2
|
10
10
|
|
11
|
+
**Fix**: (WebSockets) fixed an issue where WebSocket message events would attempt to create a String object outside the GVL.
|
12
|
+
|
13
|
+
**Fix**: (`Iodine::Connection`) minor updated to the documentation and memory validation system.
|
14
|
+
|
15
|
+
#### Change log v.0.6.2
|
16
|
+
|
11
17
|
**Fix**: (`Iodine::PubSub`) fixed an issue where lazy initialization would cause the shutdown process to crash if no Pub/Sub engines were ever registered (fixes an attempt to seek within an uninitialized data structure). Credit to @sj26 (Samuel Cochran) for reporting the issue.
|
12
18
|
|
13
19
|
#### Change log v.0.6.1
|
@@ -100,14 +100,17 @@ typedef struct {
|
|
100
100
|
/* a callback for the GC (marking active objects) */
|
101
101
|
static void iodine_connection_data_mark(void *c_) {
|
102
102
|
iodine_connection_data_s *c = c_;
|
103
|
-
if (c
|
103
|
+
if (!c) {
|
104
|
+
return;
|
105
|
+
}
|
106
|
+
if (c->info.handler && c->info.handler != Qnil) {
|
104
107
|
rb_gc_mark(c->info.handler);
|
105
108
|
}
|
106
109
|
if (c->info.env && c->info.env != Qnil) {
|
107
110
|
rb_gc_mark(c->info.env);
|
108
111
|
}
|
109
112
|
}
|
110
|
-
/* a callback for the GC (
|
113
|
+
/* a callback for the GC (freeing inactive objects) */
|
111
114
|
static void iodine_connection_data_free(void *c_) {
|
112
115
|
iodine_connection_data_s *data = c_;
|
113
116
|
if (spn_sub(&data->ref, 1))
|
@@ -129,7 +132,7 @@ const rb_data_type_t iodine_connection_data_type = {
|
|
129
132
|
.dsize = iodine_connection_data_size,
|
130
133
|
},
|
131
134
|
.data = NULL,
|
132
|
-
.flags = RUBY_TYPED_FREE_IMMEDIATELY,
|
135
|
+
// .flags = RUBY_TYPED_FREE_IMMEDIATELY,
|
133
136
|
};
|
134
137
|
|
135
138
|
/* Iodine::PubSub::Engine.allocate */
|
@@ -177,7 +180,9 @@ Ruby Connection Methods - write, close open? pending
|
|
177
180
|
static VALUE iodine_connection_write(VALUE self, VALUE data) {
|
178
181
|
iodine_connection_data_s *c = iodine_connection_validate_data(self);
|
179
182
|
if (!c || sock_isclosed(c->info.uuid)) {
|
180
|
-
|
183
|
+
// don't throw exceptions - closed connections are unavoidable.
|
184
|
+
return Qnil;
|
185
|
+
// rb_raise(rb_eIOError, "Connection closed or invalid.");
|
181
186
|
}
|
182
187
|
switch (c->info.type) {
|
183
188
|
case IODINE_CONNECTION_WEBSOCKET:
|
@@ -231,7 +236,7 @@ static VALUE iodine_connection_close(VALUE self) {
|
|
231
236
|
iodine_connection_data_s *c = iodine_connection_validate_data(self);
|
232
237
|
if (c && !sock_isclosed(c->info.uuid)) {
|
233
238
|
if (c->info.type == IODINE_CONNECTION_WEBSOCKET) {
|
234
|
-
websocket_close(c->info.arg);
|
239
|
+
websocket_close(c->info.arg); /* sends WebSocket close packet */
|
235
240
|
} else {
|
236
241
|
sock_close(c->info.uuid);
|
237
242
|
}
|
@@ -250,6 +255,9 @@ static VALUE iodine_connection_is_open(VALUE self) {
|
|
250
255
|
/**
|
251
256
|
* Returns the number of pending `write` operations that need to complete
|
252
257
|
* before the next `on_drained` callback is called.
|
258
|
+
*
|
259
|
+
* Returns -1 if the connection is closed and 0 if `on_drained` won't be
|
260
|
+
* scheduled (no pending `write`).
|
253
261
|
*/
|
254
262
|
static VALUE iodine_connection_pending(VALUE self) {
|
255
263
|
iodine_connection_data_s *c = iodine_connection_validate_data(self);
|
data/ext/iodine/iodine_http.c
CHANGED
@@ -139,7 +139,7 @@ static void iodine_ws_on_message(ws_s *ws, char *data, size_t size,
|
|
139
139
|
.is_text = is_text,
|
140
140
|
.io = (VALUE)websocket_udata(ws),
|
141
141
|
};
|
142
|
-
IodineCaller.
|
142
|
+
IodineCaller.enterGVL(iodine_ws_fire_message, &msg);
|
143
143
|
}
|
144
144
|
/**
|
145
145
|
* The (optional) on_open callback will be called once the websocket
|
data/ext/iodine/iodine_pubsub.c
CHANGED
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.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -281,7 +281,7 @@ requirements:
|
|
281
281
|
- Ruby >= 2.2.2 required for Rack 2.
|
282
282
|
- Ruby >= 2.4.0 recommended.
|
283
283
|
rubyforge_project:
|
284
|
-
rubygems_version: 2.7.
|
284
|
+
rubygems_version: 2.7.6
|
285
285
|
signing_key:
|
286
286
|
specification_version: 4
|
287
287
|
summary: iodine - a fast HTTP / Websocket Server with Pub/Sub support, optimized for
|