app/controllers/extface/handler_controller.rb in extface-0.5.1 vs app/controllers/extface/handler_controller.rb in extface-0.5.2

- old
+ new

@@ -32,20 +32,21 @@ else Extface.redis_block do |r| r.append device.uuid, request.body.read @full_buffer = r.get device.uuid end - while @full_buffer.present? && bytes_porcessed = device.driver.pre_handle(@full_buffer.b) #handle more than one valid packet in the buffer + while @full_buffer.b.present? && bytes_porcessed = device.driver.pre_handle(@full_buffer.b) #handle more than one valid packet in the buffer Extface.redis_block do |r| r.set device.uuid, @full_buffer.b[bytes_porcessed..-1] @full_buffer = r.get device.uuid end end #stream_job # stream right now :) status = :ok end response.stream.write '' rescue => e + p e p e.message render nothing: true, status: :internal_server_error ensure response.stream.close end