iodine 0.4.15 → 0.4.16
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 +5 -5
- data/CHANGELOG.md +72 -72
- data/ext/iodine/websocket_parser.h +42 -17
- data/lib/iodine/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '05830f6522c10a7287f298b6e4b7036ae90c958e28764f485f3e1b231fe8e953'
|
4
|
+
data.tar.gz: 41cfef0ab58ccdcb11f7d9437e6cc9a8454580073c89ad98701dfe9604abba74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3ff1d96d782bbf698ea13bd23a57972abcc94e2ce155f4863395efc67a91694997d9f44e1d2dd35e4ec5fd181064242e1ff6fb9f08e3208694b2e582a440b23
|
7
|
+
data.tar.gz: c4a014449954157add87616fa7ffe376499204c02b10d313a44b7edba5ccf1a2e865e98ed883e4b9fbf0be8c00f16d0a7def400f30cb84cc4b391f882d2582b4
|
data/CHANGELOG.md
CHANGED
@@ -6,52 +6,52 @@ Please notice that this change log contains changes for upcoming releases as wel
|
|
6
6
|
|
7
7
|
## Changes:
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
**Update**: (`facil.io`) updating the facil.io library version to use the 0.5.8 released version.
|
9
|
+
---
|
12
10
|
|
13
|
-
|
11
|
+
#### Change log v.0.4.16
|
14
12
|
|
15
|
-
**Fix**: (`
|
13
|
+
**Fix**: (`websocket_parser`) The websocket parser had a memory offset and alignment handling issue in it's unmasking (XOR) logic and the new memory alignment protection code. The issue would impact the parser in rare occasions when multiple messages where pipelined in the internal buffer and their length produced an odd alignment (the issue would occur with very fast clients, or a very stressed server).
|
16
14
|
|
17
|
-
|
15
|
+
#### Change log v.0.4.15
|
18
16
|
|
19
|
-
**
|
17
|
+
**Update**: (`facil.io`) updating the facil.io library version to use the 0.5.8 released version.
|
20
18
|
|
21
|
-
|
19
|
+
This includes the following changes (as well as other minor changes), as detailed in facil.io's CHANGELOG:
|
22
20
|
|
23
21
|
**Compatibility**: (`websocket_parser`) removed unaligned memory access from the XOR logic in the parser, making it more compatible with older CPU systems that don't support unaligned memory access or 64 bit word lengths.
|
24
22
|
|
25
23
|
**Optimization**: (`defer`) rewrote the data structure to use a hybrid cyclic buffer and linked list for the task queue (instead of a simple linked list), optimizing locality and minimizing memory allocations.
|
26
24
|
|
27
|
-
**Misc**: minor updates and tweaks, such as adding the `fiobj_ary2prt` function for operations such as quick sort, updating some documentation etc'.
|
28
|
-
|
29
|
-
**Fix**: (`fiobj`) fixed an where `gcc` would complain about overwriting the `fio_cstr_s` struct due to `const` members. Credit to @vit1251 for exposing this issue.
|
30
|
-
|
31
|
-
**Fix**: (`fiobj`) fixed NULL pointer testing for `fiobj_free(NULL)`.
|
32
|
-
|
33
25
|
**Compatibility**: (`gcc-6`) Fix some compatibility concerns with `gcc` version 6, as well as some warnings that were exposed when testing with `gcc`.
|
34
26
|
|
35
|
-
|
27
|
+
---
|
36
28
|
|
37
29
|
#### Change log v.0.4.14
|
38
30
|
|
39
31
|
**Fix**: (`facil.io`) fixes an issue where timer monitoring would report failure when the timer exists and is being monitored.
|
40
32
|
|
33
|
+
---
|
34
|
+
|
41
35
|
#### Change log v.0.4.12
|
42
36
|
|
43
37
|
**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.
|
44
38
|
|
39
|
+
---
|
40
|
+
|
45
41
|
#### Change log v.0.4.11
|
46
42
|
|
47
43
|
**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.
|
48
44
|
|
45
|
+
---
|
46
|
+
|
49
47
|
#### Change log v.0.4.10
|
50
48
|
|
51
49
|
**Portability**: (`mac OS High Sierra`) iodine will load the Objective C library on macOS machines before starting up the server - this will prevent `fork` from crashing the server on macOS High Sierra, see [discussion here](https://github.com/puma/puma/issues/1421).
|
52
50
|
|
53
51
|
**Fix**: (`facil.io`) fixes an error with the new Websocket parser (introduced in v. 0.4.9) that caused medium sized messages (127 Bytes - 64Kib) to be parsed incorrectly. Apologies. The test program I used seems to have validated messages using length comparison (instead of data comparison). Credit to Tom Lahti (@uidzip) for exposing the issue.
|
54
52
|
|
53
|
+
---
|
54
|
+
|
55
55
|
#### Change log v.0.4.9
|
56
56
|
|
57
57
|
**Change**: (`facil.io`) the internal Websocket parser was replaced with something easier to read, for maintainability reasons. Performance seems to be mostly unaffected (sometimes it's faster and sometimes it's slower, common case is slightly optimized).
|
@@ -64,7 +64,7 @@ This includes the following changes (as well as other minor changes), as detaile
|
|
64
64
|
|
65
65
|
**Fix**: (`facil.io`) timer timeout review is now correctly ignored, preventing the timer from being shut down prematurely.
|
66
66
|
|
67
|
-
|
67
|
+
---
|
68
68
|
|
69
69
|
#### Change log v.0.4.8
|
70
70
|
|
@@ -74,7 +74,7 @@ This includes the following changes (as well as other minor changes), as detaile
|
|
74
74
|
|
75
75
|
**Performance**: The `now` HTTP Date string is now cached for up to 2 seconds, improving performance for `Date`, `Last-Modified` and Iodine logging messages that relate to the current time. However, it's likely that Rack will write it's own date string, masking this feature.
|
76
76
|
|
77
|
-
|
77
|
+
---
|
78
78
|
|
79
79
|
#### Change log v.0.4.7
|
80
80
|
|
@@ -88,7 +88,7 @@ This includes the following changes (as well as other minor changes), as detaile
|
|
88
88
|
|
89
89
|
**Fix**: (`defer`) a shutdown issue in `defer_perform_in_fork` was detected by @cdkrot and his fix was implemented.
|
90
90
|
|
91
|
-
|
91
|
+
---
|
92
92
|
|
93
93
|
#### Change log v.0.4.6
|
94
94
|
|
@@ -96,25 +96,25 @@ This includes the following changes (as well as other minor changes), as detaile
|
|
96
96
|
|
97
97
|
**Fix**: (from `facil.io`) fix `SIGTERM` handling, make sure sibling processes exit when a sibling dies.
|
98
98
|
|
99
|
-
|
99
|
+
---
|
100
100
|
|
101
101
|
#### Change log v.0.4.5
|
102
102
|
|
103
103
|
**Fix**: fix static file service for `X-Sendfile` as well as static error file fallback pages (404.html etc').
|
104
104
|
|
105
|
-
|
105
|
+
---
|
106
106
|
|
107
107
|
#### Change log v.0.4.4
|
108
108
|
|
109
109
|
**Fix**: fixed an issue related to Ruby 2.3 optimizations of String management (an issue that didn't seem to effect Ruby 2.4). This fix disables the recyclable buffer implemented for the `on_message` Websocket callback. The callback will now receive a copy of the buffer (not the buffer itself), so there is no risk of collisions between the network buffer (managed in C) and the `on_message(data)` String (managed by Ruby).
|
110
110
|
|
111
|
-
|
111
|
+
---
|
112
112
|
|
113
113
|
#### Change log v.0.4.3
|
114
114
|
|
115
115
|
**Fix**: fixed a possible issue in fragmented pipelined Websocket messages.
|
116
116
|
|
117
|
-
|
117
|
+
---
|
118
118
|
|
119
119
|
#### Change log v.0.4.2
|
120
120
|
|
@@ -122,7 +122,7 @@ This includes the following changes (as well as other minor changes), as detaile
|
|
122
122
|
|
123
123
|
**Fix**: fixed a possible issue with high-jacking which might cause the server to hang.
|
124
124
|
|
125
|
-
|
125
|
+
---
|
126
126
|
|
127
127
|
#### Change log v.0.4.1
|
128
128
|
|
@@ -130,7 +130,7 @@ This includes the following changes (as well as other minor changes), as detaile
|
|
130
130
|
|
131
131
|
**Fix** move the `rake-compiler` dependency to "development" instead of "runtime". Credit to Luis Lavena (@luislavena) for exposing the issue (#19).
|
132
132
|
|
133
|
-
|
133
|
+
---
|
134
134
|
|
135
135
|
#### Change log v.0.4.0
|
136
136
|
|
@@ -176,13 +176,13 @@ Iodine::HTTP.listen port: 3000, app: my_app2, public: "./www"
|
|
176
176
|
Iodine.start
|
177
177
|
```
|
178
178
|
|
179
|
-
|
179
|
+
---
|
180
180
|
|
181
181
|
#### Change log v.0.3.6
|
182
182
|
|
183
183
|
**Update**: Now using `facil.io` v.0.4.3. This fixes some delays in websocket packet flushing (latency), as well as other internal polishes. It also promises some possible future feature extensions that could add a major performance boost.
|
184
184
|
|
185
|
-
|
185
|
+
---
|
186
186
|
|
187
187
|
#### Change log v.0.3.5
|
188
188
|
|
@@ -190,13 +190,13 @@ Iodine.start
|
|
190
190
|
|
191
191
|
**Minor changes**: This release incorporates some more minor changes from the [`facil.io` 0.4.2 update](https://github.com/boazsegev/facil.io/releases/tag/v.0.4.2).
|
192
192
|
|
193
|
-
|
193
|
+
---
|
194
194
|
|
195
195
|
#### Change log v.0.3.4
|
196
196
|
|
197
197
|
**Fix**: (`sock`, `facil`, bscrypt) Add missing `static` keywords to prevent state collisions with other libraries.
|
198
198
|
|
199
|
-
|
199
|
+
---
|
200
200
|
|
201
201
|
#### Change log v.0.3.3
|
202
202
|
|
@@ -208,7 +208,7 @@ Iodine.start
|
|
208
208
|
|
209
209
|
**Compatibility**: (from `facil.io`) Added spaces after header names (`:` => `: `), since some parsers don't seem to read the RFC.
|
210
210
|
|
211
|
-
|
211
|
+
---
|
212
212
|
|
213
213
|
#### Change log v.0.3.2
|
214
214
|
|
@@ -216,12 +216,12 @@ Iodine.start
|
|
216
216
|
|
217
217
|
**Fix**: (from `facil.io`) fixed stream response logging.
|
218
218
|
|
219
|
-
|
219
|
+
---
|
220
220
|
|
221
221
|
#### Change log v.0.3.1
|
222
222
|
|
223
223
|
**Update**: Follow `facil.io`'s update for healthier thread throttling and energy consumption.
|
224
|
-
|
224
|
+
---
|
225
225
|
|
226
226
|
#### Change log v.0.3.1
|
227
227
|
|
@@ -229,31 +229,31 @@ Iodine.start
|
|
229
229
|
|
230
230
|
**Gem Specification update**: We updated the gem specification to allow for Rack 1.x users and to update the gem description.
|
231
231
|
|
232
|
-
|
232
|
+
---
|
233
233
|
|
234
234
|
#### Change log v.0.3.0
|
235
235
|
|
236
236
|
**`facil.io` C Core Update**: The C library core that drives Iodine [`facil.io`](http://facil.io) was updated to version 0.4.0 and Iodine follows closely on the heels of this update. The transition was easy enough and the API remains unchanged... but because the performance gain was so big and because it's a new code base, we opted to bump the minor release version.
|
237
237
|
|
238
|
-
|
238
|
+
---
|
239
239
|
|
240
240
|
#### Change log v.0.2.17
|
241
241
|
|
242
242
|
**Performance**: Enhanced Performance for single threaded / blocking applications by adding a dedicated IO thread. This is related to issue #14.
|
243
243
|
|
244
|
-
|
244
|
+
---
|
245
245
|
|
246
246
|
#### Change log v.0.2.16
|
247
247
|
|
248
248
|
**Update**: iodine can now run as a basic HTTP static file server without a Ruby application (no `config.ru`) when the `-www` option is used from the command line.
|
249
249
|
|
250
|
-
|
250
|
+
---
|
251
251
|
|
252
252
|
#### Change log v.0.2.15
|
253
253
|
|
254
254
|
**Fix**: Fixed typo in logging and code comments, credit to @jmoriau in PR #13.
|
255
255
|
|
256
|
-
|
256
|
+
---
|
257
257
|
|
258
258
|
#### Change log v.0.2.14
|
259
259
|
|
@@ -263,7 +263,7 @@ Iodine.start
|
|
263
263
|
|
264
264
|
**Deprecation**: In version 0.2.1 we have notified that the the Websocket method `uuid` was deprecated in favor of `conn_id`, as suggested by the [Rack Websocket Draft](https://github.com/rack/rack/pull/1107). This deprecation is now enforced.
|
265
265
|
|
266
|
-
|
266
|
+
---
|
267
267
|
|
268
268
|
#### Change log v.0.2.13
|
269
269
|
|
@@ -271,13 +271,13 @@ Iodine.start
|
|
271
271
|
|
272
272
|
**Credit**: credit to Elia Schito (@elia) and Augusts Bautra (@Epigene) for fixing parts of the documentation (PR #11 , #12).
|
273
273
|
|
274
|
-
|
274
|
+
---
|
275
275
|
|
276
276
|
#### Change log v.0.2.12
|
277
277
|
|
278
278
|
**Fix**: removed `mempool` after it failed some stress and concurrency tests.
|
279
279
|
|
280
|
-
|
280
|
+
---
|
281
281
|
|
282
282
|
#### Change log v.0.2.11
|
283
283
|
|
@@ -287,7 +287,7 @@ Iodine.start
|
|
287
287
|
|
288
288
|
**Update**: lessons learned from `facil.io` have been implemented for better compatibility of Iodine's core C layer.
|
289
289
|
|
290
|
-
|
290
|
+
---
|
291
291
|
|
292
292
|
#### Change log v.0.2.10
|
293
293
|
|
@@ -314,13 +314,13 @@ Iodine.start
|
|
314
314
|
* `bscrypt` random generator (where `dev/random` is unavailable) should now provide more entropy.
|
315
315
|
|
316
316
|
|
317
|
-
|
317
|
+
---
|
318
318
|
|
319
319
|
#### Change log v.0.2.9
|
320
320
|
|
321
321
|
**Fix**: fixed a gcc-4.8 compatibility issue that prevented iodine 0.2.8 from compiling on Heroku's cedar-14 stack. This was related to missing system include files in gcc-4.8. It should be noted that Heroku's stack and compiler (which utilizes Ubuntu 14) has known issues and / or limited support for some of it's published features... but I should have remembered that before releasing version 0.2.8... sorry about that.
|
322
322
|
|
323
|
-
|
323
|
+
---
|
324
324
|
|
325
325
|
#### Change log v.0.2.8
|
326
326
|
|
@@ -328,7 +328,7 @@ Iodine.start
|
|
328
328
|
|
329
329
|
**Housekeeping**: Cleaned up some code, removed old files, copied over the latest [`facil.io`](http://facil.io) library. There's probably some more housekeeping left to perform, especially anywhere where documentation is concerned. I welcome help with documentation.
|
330
330
|
|
331
|
-
|
331
|
+
---
|
332
332
|
|
333
333
|
#### Change log v.0.2.7
|
334
334
|
|
@@ -336,13 +336,13 @@ Iodine.start
|
|
336
336
|
|
337
337
|
**Update**: Automated the number of processes (forks) and threads used when these are not explicitly specified. These follow the number of cores / 2.
|
338
338
|
|
339
|
-
|
339
|
+
---
|
340
340
|
|
341
341
|
#### Change log v.0.2.6
|
342
342
|
|
343
343
|
**Update**: The IO reactor review will now be delayed until all events scheduled are done. This means that is events schedule future events, no IO data will be reviewed until all scheduled data is done. Foolish use might cause infinite loops that skip the IO reactor, but otherwise performance is improved (since the IO reactor might cause a thread to "sleep", delaying event execution).
|
344
344
|
|
345
|
-
|
345
|
+
---
|
346
346
|
|
347
347
|
#### Change log v.0.2.5
|
348
348
|
|
@@ -350,7 +350,7 @@ Iodine.start
|
|
350
350
|
|
351
351
|
**Minor Fix**: Fix Iodine::Rack's startup message's `fprintf` call to fit correct argument sizes (Linux warnings).
|
352
352
|
|
353
|
-
|
353
|
+
---
|
354
354
|
|
355
355
|
#### Change log v.0.2.4
|
356
356
|
|
@@ -362,7 +362,7 @@ Iodine.start
|
|
362
362
|
|
363
363
|
**Update**: Iodine::Rack startup messages now include details regarding open file limits imposed by the OS (open file limits control the maximum allowed concurrent connections and other resource limits).
|
364
364
|
|
365
|
-
|
365
|
+
---
|
366
366
|
|
367
367
|
#### Change log v.0.2.3
|
368
368
|
|
@@ -370,7 +370,7 @@ Iodine.start
|
|
370
370
|
|
371
371
|
**Update**: The global socket `write` buffer was increased to ~16Mb (from ~4Mb), allowing for more concurrent `write` operations. However, the `write` buffer is still limited and `write` might block while the buffer is full. Blocking and "hanging" the server until there's enough room in the buffer for the requested `write` will slow the server down while keeping it healthy and more secure. IMHO, it is the lesser of two evils.
|
372
372
|
|
373
|
-
|
373
|
+
---
|
374
374
|
|
375
375
|
#### Change log v.0.2.2
|
376
376
|
|
@@ -378,7 +378,7 @@ Iodine.start
|
|
378
378
|
|
379
379
|
**Update**: A performance warning now shows if the CPUs are significantly under-utilized (less than half are used) of if too many are utilized (more than double the amount of CPUs), warning against under-utilization or excessive context switching (respectively).
|
380
380
|
|
381
|
-
|
381
|
+
---
|
382
382
|
|
383
383
|
#### Change log v.0.2.1
|
384
384
|
|
@@ -390,7 +390,7 @@ Iodine.start
|
|
390
390
|
|
391
391
|
**Fix**: fixed an issue were the server would crash when attempting to send a long enough websocket message.
|
392
392
|
|
393
|
-
|
393
|
+
---
|
394
394
|
|
395
395
|
#### Change log v.0.2.0
|
396
396
|
|
@@ -398,7 +398,7 @@ This version is a total rewrite. The API is totally changed, nothing stayed.
|
|
398
398
|
|
399
399
|
Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby code written is just the fluff and feathers.
|
400
400
|
|
401
|
-
|
401
|
+
---
|
402
402
|
|
403
403
|
### deprecation of the 0.1.x version line
|
404
404
|
|
@@ -410,7 +410,7 @@ Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby
|
|
410
410
|
|
411
411
|
**Logs**: Log the number of threads utilized when starting up the server.
|
412
412
|
|
413
|
-
|
413
|
+
---
|
414
414
|
|
415
415
|
#### Change log v.0.1.20
|
416
416
|
|
@@ -420,19 +420,19 @@ Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby
|
|
420
420
|
|
421
421
|
**API Changes**: `Iodine::HTTP.max_http_buffer` was replaced with `Iodine::HTTP.max_body_size`, for a better understanding of the method's result.
|
422
422
|
|
423
|
-
|
423
|
+
---
|
424
424
|
|
425
425
|
#### Change log v.0.1.19
|
426
426
|
|
427
427
|
**Update**: added the `go_away` method to the HTTP/1 protocol, for seamless connection closeing across HTTP/2, HTTP/1 and Websockets.
|
428
428
|
|
429
|
-
|
429
|
+
---
|
430
430
|
|
431
431
|
#### Change log v.0.1.18
|
432
432
|
|
433
433
|
**Update**: The request now has the shortcut method `Request#host_name` for accessing the host's name (without the port part of the string).
|
434
434
|
|
435
|
-
|
435
|
+
---
|
436
436
|
|
437
437
|
#### Change log v.0.1.17
|
438
438
|
|
@@ -446,13 +446,13 @@ Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby
|
|
446
446
|
|
447
447
|
* Remember that sessions are never really safe, no matter how much we guard them. Session hijacking is far too easy. This is why Iodine stores the session data locally and not within the session cookie. This is also why you should review any authentication before performing sensitive tasks based on session stored authentication data.
|
448
448
|
|
449
|
-
|
449
|
+
---
|
450
450
|
|
451
451
|
#### Change log v.0.1.16
|
452
452
|
|
453
453
|
**Performance**: HTTP/1 and HTTP/2 connections now share and recycle their write buffer when while reading the response body and writing it to the IO. This (hopefully) prevents excess `malloc` calls by the interpreter.
|
454
454
|
|
455
|
-
|
455
|
+
---
|
456
456
|
|
457
457
|
#### Change log v.0.1.15
|
458
458
|
|
@@ -460,7 +460,7 @@ Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby
|
|
460
460
|
|
461
461
|
**Update**: Websockets now support the `on_ping` callback, which will be called whenever a ping was sent without error.
|
462
462
|
|
463
|
-
|
463
|
+
---
|
464
464
|
|
465
465
|
#### Change log v.0.1.14
|
466
466
|
|
@@ -468,7 +468,7 @@ Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby
|
|
468
468
|
|
469
469
|
**Performance**: the Protocol class now recycles the data string as a thread global socket buffer (different threads have different buffer strings), preventing excessive `malloc` calls by the Ruby interpreter. To keep the `data` (in `on_message(data)`) past the `on_message` method's scope, be sure to duplicate it using `data.dup`, or the string's buffer will be recycled.
|
470
470
|
|
471
|
-
|
471
|
+
---
|
472
472
|
|
473
473
|
#### Change log v.0.1.13
|
474
474
|
|
@@ -480,7 +480,7 @@ Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby
|
|
480
480
|
|
481
481
|
**Compatibility**: minor fixes and changes in preparation for Ruby 2.3.0. These may affect performance due to slower String initialization times.
|
482
482
|
|
483
|
-
|
483
|
+
---
|
484
484
|
|
485
485
|
#### Change log v.0.1.12
|
486
486
|
|
@@ -488,13 +488,13 @@ Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby
|
|
488
488
|
|
489
489
|
**Security**: set the HTTPOnly flag for session id cookies.
|
490
490
|
|
491
|
-
|
491
|
+
---
|
492
492
|
|
493
493
|
#### Change log v.0.1.11
|
494
494
|
|
495
495
|
**Fix**: fixed the Rack server Handler, which was broken in version 0.1.10.
|
496
496
|
|
497
|
-
|
497
|
+
---
|
498
498
|
|
499
499
|
#### Change log v.0.1.10
|
500
500
|
|
@@ -502,7 +502,7 @@ Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby
|
|
502
502
|
|
503
503
|
**Performance**: faster TimedEvent clearing when manually stopped. Minor improvements to direct big-file sending (recycle buffer to avoid `malloc`).
|
504
504
|
|
505
|
-
|
505
|
+
---
|
506
506
|
|
507
507
|
#### Change log v.0.1.9
|
508
508
|
|
@@ -512,7 +512,7 @@ Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby
|
|
512
512
|
|
513
513
|
**Update**: repeatedly calling `Iodine.force_start!` will now be ignored, as might have been expected. Once Iodine had started, `force_start!` cannot be called until Iodine had finished (and even than, Iodine might never be as fresh nor as young as it was).
|
514
514
|
|
515
|
-
|
515
|
+
---
|
516
516
|
|
517
517
|
#### Change log v.0.1.8
|
518
518
|
|
@@ -528,13 +528,13 @@ Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby
|
|
528
528
|
|
529
529
|
**Fix** fixed an issue where HTTP streaming would disconnect while still processing. Streaming timeout now extended to 15 seconds between response writes.
|
530
530
|
|
531
|
-
|
531
|
+
---
|
532
532
|
|
533
533
|
#### Change log v.0.1.7
|
534
534
|
|
535
535
|
Removed a deprecation notice for blocking API. Client API will remain blocking due to use-case requirements.
|
536
536
|
|
537
|
-
|
537
|
+
---
|
538
538
|
|
539
539
|
#### Change log v.0.1.6
|
540
540
|
|
@@ -548,7 +548,7 @@ Removed a deprecation notice for blocking API. Client API will remain blocking d
|
|
548
548
|
|
549
549
|
(removed after reviewing use-cases).
|
550
550
|
|
551
|
-
|
551
|
+
---
|
552
552
|
|
553
553
|
#### Change log v.0.1.5
|
554
554
|
|
@@ -556,7 +556,7 @@ Removed a deprecation notice for blocking API. Client API will remain blocking d
|
|
556
556
|
|
557
557
|
**Fix**: Fixed an issue where Iodine might take a long time to shut down after a Fatal Error during the server initialization.
|
558
558
|
|
559
|
-
|
559
|
+
---
|
560
560
|
|
561
561
|
#### Change log v.0.1.4
|
562
562
|
|
@@ -566,19 +566,19 @@ Removed a deprecation notice for blocking API. Client API will remain blocking d
|
|
566
566
|
|
567
567
|
**Fix**: fixed an issue where HTTP2 header size limit condition was not recognized by the Ruby parser (a double space issue, might be an issue with the 2.2.3 Ruby parser).
|
568
568
|
|
569
|
-
|
569
|
+
---
|
570
570
|
|
571
571
|
#### Change log v.0.1.3
|
572
572
|
|
573
573
|
**Fix**: fixed an issue with the new form/multipart parser, where the '+' sign would be converted to spaces on form fields (not uploaded files), causing in-advert potential change to the original POSTed data.
|
574
574
|
|
575
|
-
|
575
|
+
---
|
576
576
|
|
577
577
|
#### Change log v.0.1.2
|
578
578
|
|
579
579
|
**Fix**: fixed an issue where the default implementation of `ping` did not reset the timeout if the connection wasn't being closed (the default implementation checks if the Protocol is working on existing data and either resets the timer allowing the work to complete or closes the connection if no work is being done).
|
580
580
|
|
581
|
-
|
581
|
+
---
|
582
582
|
|
583
583
|
#### Change log v.0.1.1
|
584
584
|
|
@@ -592,7 +592,7 @@ Removed a deprecation notice for blocking API. Client API will remain blocking d
|
|
592
592
|
|
593
593
|
**Logging**: Better HTTP error logging and recognition.
|
594
594
|
|
595
|
-
|
595
|
+
---
|
596
596
|
|
597
597
|
#### Change log v.0.1.0
|
598
598
|
|
@@ -143,21 +143,40 @@ Message masking
|
|
143
143
|
/** used internally to mask and unmask client messages. */
|
144
144
|
void websocket_xmask(void *msg, uint64_t len, uint32_t mask) {
|
145
145
|
if (len > 7) {
|
146
|
-
/* XOR any unaligned memory (4 byte alignment) */
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
((uint8_t *)msg)[2] ^= ((uint8_t *)(&mask))[2];
|
151
|
-
|
152
|
-
|
153
|
-
((uint8_t *)msg)[1] ^= ((uint8_t *)(&mask))[1];
|
154
|
-
|
155
|
-
|
156
|
-
((uint8_t *)msg)[0] ^= ((uint8_t *)(&mask))[0];
|
157
|
-
/* rotate mask and move pointer to first 4 byte alignment */
|
158
|
-
mask = (mask << (offset << 3)) | (mask >> ((4 - offset) << 3));
|
159
|
-
msg = (void *)((uintptr_t)msg + offset);
|
160
|
-
len -= offset;
|
146
|
+
{ /* XOR any unaligned memory (4 byte alignment) */
|
147
|
+
const uintptr_t offset = 4 - ((uintptr_t)msg & 3);
|
148
|
+
// switch (offset) {
|
149
|
+
// case 3:
|
150
|
+
// ((uint8_t *)msg)[2] ^= ((uint8_t *)(&mask))[2];
|
151
|
+
// /* fallthrough */
|
152
|
+
// case 2:
|
153
|
+
// ((uint8_t *)msg)[1] ^= ((uint8_t *)(&mask))[1];
|
154
|
+
// /* fallthrough */
|
155
|
+
// case 1:
|
156
|
+
// ((uint8_t *)msg)[0] ^= ((uint8_t *)(&mask))[0];
|
157
|
+
// /* rotate mask and move pointer to first 4 byte alignment */
|
158
|
+
// mask = (mask << (offset << 3)) | (mask >> ((4 - offset) << 3));
|
159
|
+
// msg = (void *)((uintptr_t)msg + offset);
|
160
|
+
// len -= offset;
|
161
|
+
// }
|
162
|
+
switch (offset) {
|
163
|
+
case 3:
|
164
|
+
((uint8_t *)msg)[2] ^= ((uint8_t *)(&mask))[2];
|
165
|
+
/* fallthrough */
|
166
|
+
case 2:
|
167
|
+
((uint8_t *)msg)[1] ^= ((uint8_t *)(&mask))[1];
|
168
|
+
/* fallthrough */
|
169
|
+
case 1:
|
170
|
+
((uint8_t *)msg)[0] ^= ((uint8_t *)(&mask))[0];
|
171
|
+
/* rotate mask and move pointer to first 4 byte alignment */
|
172
|
+
uint64_t comb = mask | ((uint64_t)mask << 32);
|
173
|
+
((uint8_t *)(&mask))[0] = ((uint8_t *)(&comb))[0 + offset];
|
174
|
+
((uint8_t *)(&mask))[1] = ((uint8_t *)(&comb))[1 + offset];
|
175
|
+
((uint8_t *)(&mask))[2] = ((uint8_t *)(&comb))[2 + offset];
|
176
|
+
((uint8_t *)(&mask))[3] = ((uint8_t *)(&comb))[3 + offset];
|
177
|
+
msg = (void *)((uintptr_t)msg + offset);
|
178
|
+
len -= offset;
|
179
|
+
}
|
161
180
|
}
|
162
181
|
#if UINTPTR_MAX <= 0xFFFFFFFF
|
163
182
|
/* handle 4 byte XOR alignment in 32 bit mnachine*/
|
@@ -182,6 +201,7 @@ void websocket_xmask(void *msg, uint64_t len, uint32_t mask) {
|
|
182
201
|
}
|
183
202
|
#endif
|
184
203
|
}
|
204
|
+
|
185
205
|
/* XOR any leftover bytes (might be non aligned) */
|
186
206
|
switch (len) {
|
187
207
|
case 7:
|
@@ -471,7 +491,8 @@ websocket_buffer_peek(void *buffer, uint64_t len) {
|
|
471
491
|
*/
|
472
492
|
static uint64_t websocket_consume(void *buffer, uint64_t len, void *udata,
|
473
493
|
uint8_t require_masking) {
|
474
|
-
struct websocket_packet_info_s info =
|
494
|
+
volatile struct websocket_packet_info_s info =
|
495
|
+
websocket_buffer_peek(buffer, len);
|
475
496
|
if (info.head_length + info.packet_length > len)
|
476
497
|
return len;
|
477
498
|
uint64_t reminder = len;
|
@@ -482,7 +503,11 @@ static uint64_t websocket_consume(void *buffer, uint64_t len, void *udata,
|
|
482
503
|
/* unmask? */
|
483
504
|
if (info.masked) {
|
484
505
|
/* masked */
|
485
|
-
const uint32_t mask = ((uint32_t *)payload)[-1];
|
506
|
+
const uint32_t mask; // = ((uint32_t *)payload)[-1];
|
507
|
+
((uint8_t *)(&mask))[0] = ((uint8_t *)(payload))[-4];
|
508
|
+
((uint8_t *)(&mask))[1] = ((uint8_t *)(payload))[-3];
|
509
|
+
((uint8_t *)(&mask))[2] = ((uint8_t *)(payload))[-2];
|
510
|
+
((uint8_t *)(&mask))[3] = ((uint8_t *)(payload))[-1];
|
486
511
|
websocket_xmask(payload, info.packet_length, mask);
|
487
512
|
} else if (require_masking) {
|
488
513
|
/* error */
|
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.16
|
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-12-
|
11
|
+
date: 2017-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -292,7 +292,7 @@ requirements:
|
|
292
292
|
- Ruby >= 2.2.2 required for Rack 2.
|
293
293
|
- Ruby >= 2.4.0 recommended.
|
294
294
|
rubyforge_project:
|
295
|
-
rubygems_version: 2.
|
295
|
+
rubygems_version: 2.7.3
|
296
296
|
signing_key:
|
297
297
|
specification_version: 4
|
298
298
|
summary: iodine - a fast HTTP / Websocket Server with Pub/Sub support, optimized for
|