THRIFT-604: rb: nonblocking_server assumes that socket.read returns exactly one message

This patch causes every message currently in the buffer to be processed before going on.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@899725 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bryan Duxbury 2010-01-15 17:30:40 +00:00
parent 62fb2ed1fe
commit 8d41b643f9

View File

@ -160,8 +160,7 @@ module Thrift
def read_connection(fd)
@buffers[fd] << fd.read(DEFAULT_BUFFER)
frame = slice_frame!(@buffers[fd])
if frame
while(frame = slice_frame!(@buffers[fd]))
@logger.debug "#{self} is processing a frame"
@worker_queue.push [:frame, fd, frame]
end