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 +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/iodine/http/http1.rb +6 -2
- data/lib/iodine/http/http2.rb +6 -2
- data/lib/iodine/http/rack_support.rb +1 -0
- data/lib/iodine/http/websocket_client.rb +1 -0
- data/lib/iodine/settings.rb +5 -0
- data/lib/iodine/timers.rb +1 -0
- data/lib/iodine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 250a126cc91b5d00df756b4c30131c309d07b14d
|
4
|
+
data.tar.gz: a8942a8c016c08efcff06269a3fb00daedf66380
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/lib/iodine/http/http1.rb
CHANGED
@@ -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
|
data/lib/iodine/http/http2.rb
CHANGED
@@ -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
|
data/lib/iodine/settings.rb
CHANGED
@@ -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
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.1.
|
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-
|
11
|
+
date: 2015-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|