193
194
195
196
197
198
199
200
201
202
203
204
205
|
# File 'lib/excon/connection.rb', line 193
def response_call(datum)
if datum.has_key?(:response_block) && !datum[:response][:body].empty?
response_body = datum[:response][:body].dup
datum[:response][:body] = ''
content_length = remaining = response_body.bytesize
while remaining > 0
datum[:response_block].call(response_body.slice!(0, [datum[:chunk_size], remaining].min), [remaining - datum[:chunk_size], 0].max, content_length)
remaining -= datum[:chunk_size]
end
end
datum
end
|