iodine 0.6.3 → 0.6.4

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: 2f20b276e0e954dffafad0952b0bc11d306dc521b83ffe31fada885e1218c7b4
4
- data.tar.gz: 1c6bd56184c5f53a0b25e5cbe1863098063887a5bc158477ce4028e441a6e19b
3
+ metadata.gz: e70dc6f1a44784807a2fe31522003936cd257a324b44d933407c55d64e429721
4
+ data.tar.gz: cf01d140817c1ceba340047d77e22fbd7e833545360c36810e930105d5788ec2
5
5
  SHA512:
6
- metadata.gz: 3c88074a686c61146cb6d6aabbbf293c978b5b37bb031daf69aa6ac597922655a49f7f3bfb0750ff59041b5129e8206ded38bd20caa3af411150cfd102777eb5
7
- data.tar.gz: 5cc6299db78e362b668b7eaa9f481fd7d76bd5efdbb4e4ad0f232f5c882589e2e9897d5881f05185ef399e09b6cf3add7fca960a9c8186283224b9757fb664d7
6
+ metadata.gz: 10b65f02f7aab503d6bad1f5c8f5bcb16347a50a41c069e89059006373fbb9f7a74b9af1ce312c3c5be6a08c2bdb6a6b12da4b52a64c1a90488ad9261c464454
7
+ data.tar.gz: 72600bd45820eec9145d15cae4a5c7a9db9319116d85ec9e00506a8edf52fb66df95d0e1bbca4dd3afac18dd7dd1e70ba3b7bb707661f0168efec4312491c6ba
@@ -6,7 +6,11 @@ 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.6.2
9
+ #### Change log v.0.6.4
10
+
11
+ **Fix**: (HTTP/WebSockets) fixed an issue where negative status return values (such as ActionCable's `-1` status code) could cause iodine to assume an abnormal error and shut down the connection. Credit to @mdesantis (Maurizio De Santis) for opening issue #38.
12
+
13
+ #### Change log v.0.6.3
10
14
 
11
15
  **Fix**: (WebSockets) fixed an issue where WebSocket message events would attempt to create a String object outside the GVL.
12
16
 
@@ -13,7 +13,7 @@ $LOAD_PATH.unshift File.expand_path(File.join('..', '..', 'lib'), __FILE__)
13
13
  require 'bundler/setup'
14
14
  require 'iodine'
15
15
 
16
- Iodine::Rack.app = lambda do |env|
16
+ APP = lambda do |env|
17
17
  if Faye::WebSocket.websocket?(env)
18
18
  ws = Faye::WebSocket.new(env)
19
19
 
@@ -27,14 +27,18 @@ Iodine::Rack.app = lambda do |env|
27
27
  end
28
28
 
29
29
  # Return async Rack response
30
- return ws.rack_response
31
-
30
+ response = ws.rack_response
31
+ p response
32
+ response
32
33
  else
33
34
  # Normal HTTP request
34
35
  [200, { 'Content-Type' => 'text/plain' }, ["Hello\n"]]
35
36
  end
36
37
  end
37
38
 
39
+ Iodine.listen2http app: APP
40
+
41
+ Iodine.threads = 4
38
42
  Iodine.start
39
43
 
40
44
  # ws = new WebSocket("ws://localhost:3000"); ws.onmessage = function(e) {console.log("Got message!"); console.log(e.data);}; ws.onclose = function(e) {console.log("closed")}; ws.onopen = function(e) {ws.send("hi");};
@@ -683,7 +683,8 @@ static inline void *iodine_handle_request_in_GVL(void *handle_) {
683
683
  // review each header and write it to the response.
684
684
  rb_hash_foreach(response_headers, for_each_header_data, (VALUE)(h));
685
685
  // review for upgrade.
686
- if (h->status < 300 && ruby2c_review_upgrade(handle, rbresponse, env))
686
+ if ((intptr_t)h->status < 300 &&
687
+ ruby2c_review_upgrade(handle, rbresponse, env))
687
688
  goto external_done;
688
689
  // send the request body.
689
690
  if (ruby2c_response_send(handle, rbresponse, env))
@@ -65,6 +65,9 @@ static void storage_print(void) {
65
65
  spn_unlock(&lock);
66
66
  }
67
67
 
68
+ /**
69
+ * Used for debugging purposes (when testing iodine for Ruby object "leaks").
70
+ */
68
71
  static VALUE storage_print_rb(VALUE self) {
69
72
  storage_print();
70
73
  return Qnil;
@@ -26,6 +26,8 @@ module Iodine
26
26
  # def on_drained client
27
27
  # client.is_a?(Iodine::Connection) # => true
28
28
  # end
29
+ # # Allows the module to be used as a static callback object (avoiding object allocation)
30
+ # extend self
29
31
  # end
30
32
  #
31
33
  # All connection related actions can be performed using the methods provided through this class.
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = '0.6.3'.freeze
2
+ VERSION = '0.6.4'.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.6.3
4
+ version: 0.6.4
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-06-25 00:00:00.000000000 Z
11
+ date: 2018-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack