iodine 0.2.14 → 0.2.15

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: ccbe7057ea01a3ced6291824c722160e8566200c
4
- data.tar.gz: ef231d216e71b62b57331d34161858c4b3fb0284
3
+ metadata.gz: e564ce3ac693156f06a68d1f7195db9e998673f8
4
+ data.tar.gz: 21b6eea2e9ff2f1c49faa663681f1da96f33e6cf
5
5
  SHA512:
6
- metadata.gz: 00c4e4dfd7633df4fdf2f9ade456326e27671f8cb1f9dcdd0693ec6c2f1eb65a896f502c5e40065b155ee876b8f9e7be5446dccffa2b3d2cf5cf19ef52a888a4
7
- data.tar.gz: 9153c0444bdb26d6f5d3864fb7986d9851e1793e61c53387fe8e2826e7de87d48aee369f37100ebf3b9fb92fede369e3f1e7293988c4606a358e7041d4822eb1
6
+ metadata.gz: 8289974c1e83fad49cf207bcbfbe8eb5887d26de585b0b3b03999a2ac30ae6ef99919fa1becf82f04dedaa530211e8f323715819a9d8d825b475bc09f23f85d4
7
+ data.tar.gz: 6f59fc30ca85c358ff493ff1f4814aea2fbfeb84ecfbc45e392aefad3bceb5df8f10b24e78f54cc0ad371ba03152985e198d3654d97a234b993ea29a55cd14d9
@@ -8,7 +8,13 @@ Please notice that this change log contains changes for upcoming releases as wel
8
8
 
9
9
  ***
10
10
 
11
- Change log v.0.2.14
11
+ #### Change log v.0.2.15
12
+
13
+ **Fix**: Fixed typo in logging and code comments, credit to @jmoriau in PR #13.
14
+
15
+ ***
16
+
17
+ #### Change log v.0.2.14
12
18
 
13
19
  **Fix**: fixed the experimental `each_write`. An issue was found where passing a block might crash Iodine, since the block will be freed by the GC before Iodine was done with it. Now the block is correctly added to the object Registry, preventing premature memory deallocation.
14
20
 
@@ -18,7 +24,7 @@ Change log v.0.2.14
18
24
 
19
25
  ***
20
26
 
21
- Change log v.0.2.13
27
+ #### Change log v.0.2.13
22
28
 
23
29
  **Fix**: Fixed an issue presented in the C layer, where big fragmented websocket messages sent by the client could cause parsing errors and potentially, in some cases, cause a server thread to spin in a loop (DoS). Credit to @Filly for exposing the issue in the [`facil.io`](https://github.com/boazsegev/facil.io) layer. It should be noted that Chrome is the only browser where this issue could be invoked for testing.
24
30
 
@@ -26,13 +32,13 @@ Change log v.0.2.13
26
32
 
27
33
  ***
28
34
 
29
- Change log v.0.2.12
35
+ #### Change log v.0.2.12
30
36
 
31
37
  **Fix**: removed `mempool` after it failed some stress and concurrency tests.
32
38
 
33
39
  ***
34
40
 
35
- Change log v.0.2.11
41
+ #### Change log v.0.2.11
36
42
 
37
43
  **Fix**: C layer memory pool had a race-condition that could have caused, in some unlikely events, memory allocation failure for Websocket protocol handlers. This had now been addressed and fixed.
38
44
 
@@ -42,7 +48,7 @@ Change log v.0.2.11
42
48
 
43
49
  ***
44
50
 
45
- Change log v.0.2.10
51
+ #### Change log v.0.2.10
46
52
 
47
53
  **Update**: added documentation and an extra helper method to set a connection's timeout when using custom protocols (Iodine as an EventMachine alternative).
48
54
 
@@ -69,13 +75,13 @@ Change log v.0.2.10
69
75
 
70
76
  ***
71
77
 
72
- Change log v.0.2.9
78
+ #### Change log v.0.2.9
73
79
 
74
80
  **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.
75
81
 
76
82
  ***
77
83
 
78
- Change log v.0.2.8
84
+ #### Change log v.0.2.8
79
85
 
80
86
  **Memory Performance**: The Websocket connection Protocol now utilizes both a C level memory pool and a local thread storage for temporary data. This helps mitigate possible memory fragmentation issues related to long running processes and long-lived objects. In addition, the socket `read` buffer was moved from the protocol object to a local thread storage (assumes pthreads and not green threads). This minimizes the memory footprint for each connection (at the expense of memory locality) and should allow Iodine to support more concurrent connections using less system resources. Last, but not least, the default message buffer per connection starts at 4Kb instead of 16Kb (grows as needed, up to `Iodine::Rack.max_msg_size`), assuming smaller messages are the norm.
81
87
 
@@ -83,7 +89,7 @@ Change log v.0.2.8
83
89
 
84
90
  ***
85
91
 
86
- Change log v.0.2.7
92
+ #### Change log v.0.2.7
87
93
 
88
94
  **Minor Fix**: fixed an issue where a negative number of processes or threads would initiate a very large number of forks, promoting a system resource choke. Limited the number of threads (1023) and processes (127).
89
95
 
@@ -91,13 +97,13 @@ Change log v.0.2.7
91
97
 
92
98
  ***
93
99
 
94
- Change log v.0.2.6
100
+ #### Change log v.0.2.6
95
101
 
96
102
  **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).
97
103
 
98
104
  ***
99
105
 
100
- Change log v.0.2.5
106
+ #### Change log v.0.2.5
101
107
 
102
108
  **Fix:**: fix for issue #9 (credit to Jack Christensen for exposing the issue) caused by an unlocked critical section's "window of opportunity" that allowed asynchronous Websocket `each` blocks to run during the tail of the Websocket handshake (while the `on_open` callback was running in parallel).
103
109
 
@@ -105,7 +111,7 @@ Change log v.0.2.5
105
111
 
106
112
  ***
107
113
 
108
- Change log v.0.2.4
114
+ #### Change log v.0.2.4
109
115
 
110
116
  **Minor Fix**: Patched Iodine against Apple's broken `getrlimit` on macOS. This allows correct auto-setting of open file limits for the socket layer.
111
117
 
@@ -117,7 +123,7 @@ Change log v.0.2.4
117
123
 
118
124
  ***
119
125
 
120
- Change log v.0.2.3
126
+ #### Change log v.0.2.3
121
127
 
122
128
  **Update**: The `write` system call is now deferred when resources allow, meaning that (as long as the `write` buffer isn't full) `write` is not only non-blocking, but it's performed as a separate event, outside of the Ruby GIL.
123
129
 
@@ -125,7 +131,7 @@ Change log v.0.2.3
125
131
 
126
132
  ***
127
133
 
128
- Change log v.0.2.2
134
+ #### Change log v.0.2.2
129
135
 
130
136
  **Update** The static file service now supports `ETag` caching, sending a 304 (not changed) response for valid ETags.
131
137
 
@@ -133,7 +139,7 @@ Change log v.0.2.2
133
139
 
134
140
  ***
135
141
 
136
- Change log v.0.2.1
142
+ #### Change log v.0.2.1
137
143
 
138
144
  **Notice**: The [Rack Websocket Draft](https://github.com/rack/rack/pull/1107) does not support the `each` and `defer` methods. Although I tried to maintain these as part of the draft, the community preferred to leave the implementation of these to the client (rather then the server). If collisions occur, these methods might be removed in the future.
139
145
 
@@ -145,7 +151,7 @@ Change log v.0.2.1
145
151
 
146
152
  ***
147
153
 
148
- Change log v.0.2.0
154
+ #### Change log v.0.2.0
149
155
 
150
156
  This version is a total rewrite. The API is totally changed, nothing stayed.
151
157
 
@@ -155,7 +161,7 @@ Iodine is now written in C, as a C extension for Ruby. The little, if any, ruby
155
161
 
156
162
  ### deprecation of the 0.1.x version line
157
163
 
158
- Change log v.0.1.21
164
+ #### Change log v.0.1.21
159
165
 
160
166
  **Optimization**: Minor optimizations. i.e. - creates 1 less Time object per request (The logging still creates a Time object unless disabled using `Iodine.logger = nil`).
161
167
 
@@ -165,7 +171,7 @@ Change log v.0.1.21
165
171
 
166
172
  ***
167
173
 
168
- Change log v.0.1.20
174
+ #### Change log v.0.1.20
169
175
 
170
176
  **Update/Fix**: Updated the `x-forwarded-for` header recognition, to accommodate an Array formatting sometimes used (`["ip1", "ip2", ...]`).
171
177
 
@@ -175,19 +181,19 @@ Change log v.0.1.20
175
181
 
176
182
  ***
177
183
 
178
- Change log v.0.1.19
184
+ #### Change log v.0.1.19
179
185
 
180
186
  **Update**: added the `go_away` method to the Http/1 peorotocol, for seamless connection closeing across Http/2, Http/1 and Websockets.
181
187
 
182
188
  ***
183
189
 
184
- Change log v.0.1.18
190
+ #### Change log v.0.1.18
185
191
 
186
192
  **Update**: The request now has the shortcut method `Request#host_name` for accessing the host's name (without the port part of the string).
187
193
 
188
194
  ***
189
195
 
190
- Change log v.0.1.17
196
+ #### Change log v.0.1.17
191
197
 
192
198
  **Credit**: thanks you @frozenfoxx for going through the readme and fixing my broken grammer.
193
199
 
@@ -201,13 +207,13 @@ Change log v.0.1.17
201
207
 
202
208
  ***
203
209
 
204
- Change log v.0.1.16
210
+ #### Change log v.0.1.16
205
211
 
206
212
  **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 (hopefuly) prevents excess `malloc` calls by the interperter.
207
213
 
208
214
  ***
209
215
 
210
- Change log v.0.1.15
216
+ #### Change log v.0.1.15
211
217
 
212
218
  **Update**: IO reactor will now update IO status even when tasks are pending. IO will still be read only when there are no more tasks to handle, but this allows chained tasks to relate to the updated IO status. i.e. this should improve websocket availability for broadcasting (delay from connection to availability might occure until IO is registered).
213
219
 
@@ -215,7 +221,7 @@ Change log v.0.1.15
215
221
 
216
222
  ***
217
223
 
218
- Change log v.0.1.14
224
+ #### Change log v.0.1.14
219
225
 
220
226
  **Update**: the Response now supports `redirect_to` for both permanent and temporary redirection, with an optional `flash` cookie setup.
221
227
 
@@ -223,7 +229,7 @@ Change log v.0.1.14
223
229
 
224
230
  ***
225
231
 
226
- Change log v.0.1.13
232
+ #### Change log v.0.1.13
227
233
 
228
234
  **Change**: Session cookie lifetime is now limited to the browser's session. The local data will still persist until the tmp-folder is cleared (when using session file storage).
229
235
 
@@ -235,7 +241,7 @@ Change log v.0.1.13
235
241
 
236
242
  ***
237
243
 
238
- Change log v.0.1.12
244
+ #### Change log v.0.1.12
239
245
 
240
246
  **Update**: Passing a hash as the cookie value will allow to set cookie parameters using the {Response#set_cookie} options. i.e.: `cookies['key']= {value: "lock", max_age: 20}`.
241
247
 
@@ -243,13 +249,13 @@ Change log v.0.1.12
243
249
 
244
250
  ***
245
251
 
246
- Change log v.0.1.11
252
+ #### Change log v.0.1.11
247
253
 
248
254
  **Fix**: fixed the Rack server Handler, which was broken in version 0.1.10.
249
255
 
250
256
  ***
251
257
 
252
- Change log v.0.1.10
258
+ #### Change log v.0.1.10
253
259
 
254
260
  **Fix**: make sure the WebsocketClient doesn't automatically renew the connection when the connection was manually closed by the client.
255
261
 
@@ -257,7 +263,7 @@ Change log v.0.1.10
257
263
 
258
264
  ***
259
265
 
260
- Change log v.0.1.9
266
+ #### Change log v.0.1.9
261
267
 
262
268
  **Fix**: WebsocketClient connection renewal will now keep the same WebsocketClient instance object.
263
269
 
@@ -267,7 +273,7 @@ Change log v.0.1.9
267
273
 
268
274
  ***
269
275
 
270
- Change log v.0.1.8
276
+ #### Change log v.0.1.8
271
277
 
272
278
  **Fix**: Websocket broadcasts are now correctly executed within the IO's mutex locker. This maintains the idea that only one thread at a time should be executing code on behald of any given Protocol object ("yes" to concurrency between objects but "no" to concurrency within objects).
273
279
 
@@ -283,13 +289,13 @@ Change log v.0.1.8
283
289
 
284
290
  ***
285
291
 
286
- Change log v.0.1.7
292
+ #### Change log v.0.1.7
287
293
 
288
294
  Removed a deprecation notice for blocking API. Client API will remain blocking due to use-case requirements.
289
295
 
290
296
  ***
291
297
 
292
- Change log v.0.1.6
298
+ #### Change log v.0.1.6
293
299
 
294
300
  **Fix**: fixed an issue where a session key-value pair might not get deleted when using `session.delete key` and the `key` is not a String object. Also, now setting a key's value to `nil` should delete the key-value pair.
295
301
 
@@ -303,7 +309,7 @@ Change log v.0.1.6
303
309
 
304
310
  ***
305
311
 
306
- Change log v.0.1.5
312
+ #### Change log v.0.1.5
307
313
 
308
314
  **Feature**: The Response#body can now be set to a File object, allowing Iodine to preserve memory when serving large static files from disc. Limited Range requests are also supported - together, these changes allow Iodine to serve media files (such as movies) while suffering a smaller memory penalty and supporting a wider variaty of players (Safari requires Range request support for it's media player).
309
315
 
@@ -311,7 +317,7 @@ Change log v.0.1.5
311
317
 
312
318
  ***
313
319
 
314
- Change log v.0.1.4
320
+ #### Change log v.0.1.4
315
321
 
316
322
  **Fix**: fixed an issue with where the WebsocketClient#on_close wouldn't be called for a renewable Websocket connection during shutdown.
317
323
 
@@ -321,19 +327,19 @@ Change log v.0.1.4
321
327
 
322
328
  ***
323
329
 
324
- Change log v.0.1.3
330
+ #### Change log v.0.1.3
325
331
 
326
332
  **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 inadvert potential change to the original POSTed data.
327
333
 
328
334
  ***
329
335
 
330
- Change log v.0.1.2
336
+ #### Change log v.0.1.2
331
337
 
332
338
  **Fix**: fixed an issue where the default implementation of `ping` didn 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).
333
339
 
334
340
  ***
335
341
 
336
- Change log v.0.1.1
342
+ #### Change log v.0.1.1
337
343
 
338
344
  **Fix**: Fixed an issue where slow processing of Http/1 requests could cause timeout disconnections to occur while the request is being processed.
339
345
 
@@ -347,7 +353,7 @@ Change log v.0.1.1
347
353
 
348
354
  ***
349
355
 
350
- Change log v.0.1.0
356
+ #### Change log v.0.1.0
351
357
 
352
358
  **First actual release**:
353
359
 
data/README.md CHANGED
@@ -31,8 +31,7 @@ Iodine includes a light and fast HTTP and Websocket server written in C that was
31
31
  Using the Iodine server is easy, simply add Iodine as a gem to your Rack application:
32
32
 
33
33
  ```ruby
34
- # notice that the `git` is required since Iodine 2.0 hadn't been released just yet.
35
- gem 'iodine', :git => 'https://github.com/boazsegev/iodine.git'
34
+ gem 'iodine', '>=0.2'
36
35
  ```
37
36
 
38
37
  Iodine will calculate, when possible, a good enough default concurrency model for fast applications... this might not fit your application if you use database access or other blocking calls.
@@ -10,10 +10,12 @@ require 'rack/lint'
10
10
  # Valid values are "hello", "slow" (debugs env values), "simple"
11
11
  app = 'hello'
12
12
  # This is a simple Hello World Rack application, for benchmarking.
13
+ HELLO_RESPONSE = [200, { 'Content-Type'.freeze => 'text/html'.freeze,
14
+ 'Content-Length'.freeze => '16'.freeze }.freeze,
15
+ ['Hello from Rack!'.freeze]].freeze
16
+
13
17
  hello = proc do |_env|
14
- [200, { 'Content-Type'.freeze => 'text/html'.freeze,
15
- 'Content-Length'.freeze => '16'.freeze },
16
- ['Hello from Rack!'.freeze]]
18
+ HELLO_RESPONSE
17
19
  end
18
20
 
19
21
  slow = proc do |env|
@@ -352,7 +352,7 @@ too_big:
352
352
  }
353
353
 
354
354
  /* *****************************************************************************
355
- HTTP/1.1 listenning API implementation
355
+ HTTP/1.1 listening API implementation
356
356
  */
357
357
 
358
358
  #undef http1_listen
@@ -435,10 +435,10 @@ void Init_DynamicProtocol(void) {
435
435
  Iodine functions
436
436
  */
437
437
 
438
- /** Sets up a listenning socket. Conncetions received at the assigned port will
438
+ /** Sets up a listening socket. Conncetions received at the assigned port will
439
439
  be handled by the assigned handler.
440
440
 
441
- Multiple services (listenning sockets) can be registered before starting the
441
+ Multiple services (listening sockets) can be registered before starting the
442
442
  Iodine event loop. */
443
443
  static VALUE iodine_listen_dyn_protocol(VALUE self, VALUE port, VALUE handler) {
444
444
  // validate that the handler is a class and include the Iodine::Protocol
@@ -262,7 +262,7 @@ inline static void listen_for_stop_signal(void) {
262
262
  }
263
263
 
264
264
  /* *****************************************************************************
265
- The Listenning Protocol
265
+ The Listening Protocol
266
266
  */
267
267
 
268
268
  static const char *listener_protocol_name = "listening protocol __internal__";
@@ -327,7 +327,7 @@ inline static void listener_on_server_start(void) {
327
327
  for (size_t i = 0; i < server_data.capacity; i++) {
328
328
  if (protocol_fd(i) && protocol_fd(i)->service == listener_protocol_name) {
329
329
  if (reactor_add(sock_fd2uuid(i)))
330
- perror("Couldn't register listenning socket"), exit(4);
330
+ perror("Couldn't register listening socket"), exit(4);
331
331
  // call the on_init callback
332
332
  if (((struct ListenerProtocol *)protocol_fd(i))->on_start)
333
333
  ((struct ListenerProtocol *)protocol_fd(i))
@@ -503,7 +503,7 @@ int server_listen(struct ServerServiceSettings settings) {
503
503
  if (server_data.running && reactor_add(fduuid))
504
504
  goto error;
505
505
  #if defined(SERVER_PRINT_STATE) && SERVER_PRINT_STATE == 1
506
- fprintf(stderr, "* Listenning on port %s\n", settings.port);
506
+ fprintf(stderr, "* Listening on port %s\n", settings.port);
507
507
  #endif
508
508
  return 0;
509
509
  error:
@@ -57,7 +57,7 @@ what is required for API simplicity, error protection and performance.
57
57
  * Dynamic Protocol: meanning a service can change protocols mid-stream. Example
58
58
  usecase: Websockets (HTTP Upgrade).
59
59
 
60
- * Network services: meanning multiple listenning network ports, each with it's
60
+ * Network services: meanning multiple listening network ports, each with it's
61
61
  own logic.
62
62
 
63
63
  `libserver` utilizes `libreact`, `libasync` and `libsock` to create a simple
@@ -181,7 +181,7 @@ some recommended implementation techniques, such as protocol inheritance.
181
181
 
182
182
  // struct Server; /** used internally. no public data exposed */
183
183
  struct ServerSettings; /** sets up the server's behavior */
184
- struct ServerServiceSettings; /** sets up a listenning socket's behavior */
184
+ struct ServerServiceSettings; /** sets up a listening socket's behavior */
185
185
  typedef struct Protocol protocol_s; /** controls connection events */
186
186
 
187
187
  /**************************************************************************/ /**
@@ -222,7 +222,7 @@ struct Protocol {
222
222
  /**************************************************************************/ /**
223
223
  * The Service Settings
224
224
 
225
- These settings will be used to setup listenning sockets.
225
+ These settings will be used to setup listening sockets.
226
226
  */
227
227
  struct ServerServiceSettings {
228
228
  /** Called whenever a new connection is accepted. Should return a pointer to
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = '0.2.14'.freeze
2
+ VERSION = '0.2.15'.freeze
3
3
  end
@@ -76,12 +76,12 @@ module Iodine
76
76
  @log = true if ARGV.index('-v')
77
77
  @log = false if ARGV.index('-q')
78
78
 
79
- # get/set the HTTP listenning port. Defaults to 3000.
79
+ # get/set the HTTP listening port. Defaults to 3000.
80
80
  def self.port=(val)
81
81
  @port = val
82
82
  end
83
83
 
84
- # get/set the HTTP listenning port. Defaults to 3000.
84
+ # get/set the HTTP listening port. Defaults to 3000.
85
85
  def self.port
86
86
  @port
87
87
  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.2.14
4
+ version: 0.2.15
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-03-05 00:00:00.000000000 Z
11
+ date: 2017-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack