You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by br...@apache.org on 2010/01/15 18:30:41 UTC

svn commit: r899725 - /incubator/thrift/trunk/lib/rb/lib/thrift/server/nonblocking_server.rb

Author: bryanduxbury
Date: Fri Jan 15 17:30:40 2010
New Revision: 899725

URL: http://svn.apache.org/viewvc?rev=899725&view=rev
Log:
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.

Modified:
    incubator/thrift/trunk/lib/rb/lib/thrift/server/nonblocking_server.rb

Modified: incubator/thrift/trunk/lib/rb/lib/thrift/server/nonblocking_server.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/lib/thrift/server/nonblocking_server.rb?rev=899725&r1=899724&r2=899725&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/lib/thrift/server/nonblocking_server.rb (original)
+++ incubator/thrift/trunk/lib/rb/lib/thrift/server/nonblocking_server.rb Fri Jan 15 17:30:40 2010
@@ -160,8 +160,7 @@
 
       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