iodine 0.1.9 → 0.1.11

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: 0b1ab6392f66ca513bb10c39e27ede18cf3588f8
4
- data.tar.gz: 138fe6afa9327403a8811d036dccc5f3d91b66b9
3
+ metadata.gz: 250a126cc91b5d00df756b4c30131c309d07b14d
4
+ data.tar.gz: a8942a8c016c08efcff06269a3fb00daedf66380
5
5
  SHA512:
6
- metadata.gz: 79797e0676d69aa78131e911b65d88fd1dd65305dc39d1ee62f4aecbeab96ae4d80ee021d01d337e78a84ddce23ac8a3dcebc03a9934df88f9168e1b4b2bb4e6
7
- data.tar.gz: 16a7dfe4bfc94c03718ab69c40f8ea207a7f5ea57c986b118da08eb7afc144554266cfe42a88760a555cc69ea65ddb16081e9830cba8c74e1b3ca8fd1a7946d3
6
+ metadata.gz: 8f3831ce442b7bf7bfb8f2abe1b3c9595f277f434ebb669cf11b6e204ca1c420fefddd7f6d53a1916d149a9ed589503359321750d6556d4626eb98d5d79ce0c0
7
+ data.tar.gz: da4e06d3f70e5bc3811ddb75e0b21df1ac6dacd1aa654432593b853ba49ddce9276568f09beafb10a948b7ede257d991a0d27f1b462b33869f3424a524f235a2
data/CHANGELOG.md CHANGED
@@ -8,6 +8,20 @@ Please notice that this change log contains changes for upcoming releases as wel
8
8
 
9
9
  ***
10
10
 
11
+ Change log v.0.1.11
12
+
13
+ **Fix**: fixed the Rack server Handler, which was broken in version 0.1.10.
14
+
15
+ ***
16
+
17
+ Change log v.0.1.10
18
+
19
+ **Fix**: make sure the WebsocketClient doesn't automatically renew the connection when the connection was manually closed by the client.
20
+
21
+ **Performance**: faster TimedEvent clearing when manually stopped. Minor improvements to direct big-file sending (recycle buffer to avoid malloc).
22
+
23
+ ***
24
+
11
25
  Change log v.0.1.9
12
26
 
13
27
  **Fix**: WebsocketClient connection renewal will now keep the same WebsocketClient instance object.
@@ -112,12 +112,14 @@ module Iodine
112
112
 
113
113
  send_headers response
114
114
  return log_finished(response) && (body && body.close) if request.head? || body.nil?
115
+ buffer = String.new
115
116
  until body.eof?
116
- written = write(body.read 65_536)
117
+ written = write(body.read 65_536, buffer)
117
118
  return Iodine.warn("Http/1 couldn't send response because connection was lost.") && body.close unless written
118
119
  response.bytes_written += written
119
120
  end
120
121
  body.close
122
+ buffer.clear
121
123
  close unless keep_alive
122
124
  log_finished response
123
125
  end
@@ -131,8 +133,9 @@ module Iodine
131
133
  end
132
134
  return if response.request.head?
133
135
  body = response.extract_body
136
+ buffer = String.new
134
137
  until body.eof?
135
- written = stream_data(body.read 65_536)
138
+ written = stream_data(body.read 65_536, buffer)
136
139
  return Iodine.warn("Http/1 couldn't send response because connection was lost.") && body.close unless written
137
140
  response.bytes_written += written
138
141
  end if body
@@ -141,6 +144,7 @@ module Iodine
141
144
  log_finished response
142
145
  close unless response.keep_alive
143
146
  end
147
+ buffer.clear
144
148
  body.close if body
145
149
  true
146
150
  end
@@ -67,10 +67,12 @@ module Iodine
67
67
  return body && body.close unless send_headers response, request
68
68
  return log_finished(response) && body && body.close if request.head?
69
69
  if body
70
+ buffer = String.new
70
71
  until body.eof?
71
- response.bytes_written += emit_payload(body.read(@settings[SETTINGS_MAX_FRAME_SIZE]), request[:sid], 0, (body.eof? ? 1 : 0))
72
+ response.bytes_written += emit_payload(body.read(@settings[SETTINGS_MAX_FRAME_SIZE], buffer), request[:sid], 0, (body.eof? ? 1 : 0))
72
73
  end
73
74
  body.close
75
+ buffer.clear
74
76
  else
75
77
  emit_payload('', request[:sid], 0, 1)
76
78
  end
@@ -83,9 +85,11 @@ module Iodine
83
85
  send_headers response, request
84
86
  return body && body.close if request.head?
85
87
  if body
88
+ buffer = String.new
86
89
  until body.eof?
87
- response.bytes_written += emit_payload(body.read(@settings[SETTINGS_MAX_FRAME_SIZE]), request[:sid], 0, ((finish && body.eof?) ? 1 : 0))
90
+ response.bytes_written += emit_payload(body.read(@settings[SETTINGS_MAX_FRAME_SIZE], buffer), request[:sid], 0, ((finish && body.eof?) ? 1 : 0))
88
91
  end
92
+ buffer.clear
89
93
  body.close
90
94
  elsif finish
91
95
  emit_payload('', request[:sid], 0, 1)
@@ -8,6 +8,7 @@ module Iodine
8
8
  @app = app
9
9
  Iodine.threads ||= 18
10
10
  Iodine.port = options[:Port]
11
+ RACK_DICTIONARY['rack.multiprocess'] = Iodine.processes.to_i > 1
11
12
  Iodine.protocol ||= Iodine::Http::Http1
12
13
  @pre_rack_handler = Iodine::Http.on_http unless Iodine::Http.on_http == Iodine::Http::NOT_IMPLEMENTED
13
14
  Iodine::Http.on_http self
@@ -119,6 +119,7 @@ module Iodine
119
119
 
120
120
  # closes the connection, if open
121
121
  def close
122
+ @renew = 0
122
123
  @io.close if @io
123
124
  end
124
125
 
@@ -28,6 +28,11 @@ module Iodine
28
28
  @spawn_count = count
29
29
  end
30
30
 
31
+ # Gets the number of processes that should be spawned in Server mode. Defaults to 1 (no processes spawned). See {Iodine#processes=}.
32
+ def processes
33
+ @spawn_count
34
+ end
35
+
31
36
  # Sets Iodine's server port. Defaults to the command line `-p` argument, or the ENV['PORT'] or 3000 (in this order).
32
37
  def port= port
33
38
  @port = port
data/lib/iodine/timers.rb CHANGED
@@ -30,6 +30,7 @@ module Iodine
30
30
  # @return [Iodine::TimedEvent] returns the TimedEvent object.
31
31
  def stop!
32
32
  @repeat_limit = 0
33
+ @next = @reactor.time
33
34
  self
34
35
  end
35
36
 
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.11"
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.1.9
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-02 00:00:00.000000000 Z
11
+ date: 2015-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler