qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arnaudsi...@apache.org
Subject svn commit: r586027 - /incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/Disassembler.java
Date Thu, 18 Oct 2007 16:22:48 GMT
Author: arnaudsimon
Date: Thu Oct 18 09:22:47 2007
New Revision: 586027

URL: http://svn.apache.org/viewvc?rev=586027&view=rev
Log:
changed to handle empty payload messages

Modified:
    incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/Disassembler.java

Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/Disassembler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/Disassembler.java?rev=586027&r1=586026&r2=586027&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/Disassembler.java
(original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/transport/network/Disassembler.java
Thu Oct 18 09:22:47 2007
@@ -79,6 +79,24 @@
     private void fragment(byte flags, byte type, ConnectionEvent event,
                           ByteBuffer buf, boolean first, boolean last)
     {
+        if(!buf.hasRemaining())
+        {
+            //empty data
+              byte nflags = flags;
+            if (first)
+            {
+                nflags |= FIRST_FRAME;
+                first = false;
+            }
+             nflags |= LAST_FRAME;
+              Frame frame = new Frame(nflags, type,
+                                    event.getProtocolEvent().getEncodedTrack(),
+                                    event.getChannel());
+           // frame.addFragment(buf);
+            sender.send(frame);
+        }
+        else
+        {
         while (buf.hasRemaining())
         {
             ByteBuffer slice = buf.slice();
@@ -101,6 +119,7 @@
                                     event.getChannel());
             frame.addFragment(slice);
             sender.send(frame);
+        }
         }
     }
 



Mime
View raw message