ebb 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ebb.rb +10 -12
- data/lib/ebb/version.rb +1 -1
- metadata +7 -7
data/lib/ebb.rb
CHANGED
@@ -103,6 +103,7 @@ module Ebb
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def on_open
|
106
|
+
@being_written = nil
|
106
107
|
@requests = []
|
107
108
|
@@responses[self] = []
|
108
109
|
end
|
@@ -168,13 +169,7 @@ module Ebb
|
|
168
169
|
# Note: not setting Content-Length. do it yourself.
|
169
170
|
|
170
171
|
body.each do |chunk|
|
171
|
-
|
172
|
-
write(chunk)
|
173
|
-
else
|
174
|
-
write(@head + chunk)
|
175
|
-
@head = nil
|
176
|
-
end
|
177
|
-
@connection.write
|
172
|
+
write(chunk)
|
178
173
|
end
|
179
174
|
|
180
175
|
body.on_error { close } if body.respond_to?(:on_error)
|
@@ -195,15 +190,18 @@ module Ebb
|
|
195
190
|
|
196
191
|
def finish
|
197
192
|
@finished = true
|
198
|
-
if @chunked
|
199
|
-
write("")
|
200
|
-
@connection.write
|
201
|
-
end
|
193
|
+
write("") if @chunked
|
202
194
|
end
|
203
195
|
|
204
196
|
def write(chunk)
|
205
197
|
encoded = @chunked ? "#{chunk.length.to_s(16)}\r\n#{chunk}\r\n" : chunk
|
206
|
-
@
|
198
|
+
if @head.nil?
|
199
|
+
@output << encoded
|
200
|
+
else
|
201
|
+
@output << @head + encoded
|
202
|
+
@head = nil
|
203
|
+
end
|
204
|
+
@connection.write
|
207
205
|
end
|
208
206
|
|
209
207
|
HTTP_STATUS_CODES = {
|
data/lib/ebb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ebb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ry dahl
|
@@ -38,16 +38,16 @@ files:
|
|
38
38
|
- lib/ebb/version.rb
|
39
39
|
- lib/ebb.rb
|
40
40
|
- ext/extconf.rb
|
41
|
-
- ext/ebb_ffi.c
|
42
|
-
- README
|
43
|
-
- Rakefile
|
44
|
-
- ext/ebb.c
|
45
|
-
- ext/ebb.h
|
46
41
|
- ext/ebb_request_parser.rl
|
42
|
+
- ext/rbtree.c
|
43
|
+
- ext/ebb.c
|
44
|
+
- ext/ebb_ffi.c
|
47
45
|
- ext/ebb_request_parser.c
|
48
46
|
- ext/ebb_request_parser.h
|
49
|
-
- ext/
|
47
|
+
- ext/ebb.h
|
50
48
|
- ext/rbtree.h
|
49
|
+
- README
|
50
|
+
- Rakefile
|
51
51
|
has_rdoc: false
|
52
52
|
homepage: http://ebb.rubyforge.org
|
53
53
|
post_install_message:
|