On 27/09/2010 22:11, Chris Frey wrote:
> On Mon, Sep 27, 2010 at 03:23:01PM +0100, Toby Gray wrote:
>
>> My initial feeling was to treat both cases the same, as there's clearly
>> something we don't understand going on, so it's probably best to get a
>> bug reporting that Barry doesn't work than to carry on. However I'd be
>> happy to continue the current behaviour of just skipping packets of 1
>> byte length.
> Maybe I missed it, but where do we skip packets of 1 byte in length?
> If it is something special in m_raw_channel.cc, in order to make it
> work, I'm ok with skipping such packets in that context alone.
> But I didn't think we had such a case in the general library.
Hi Chris,

Sorry, I just have been more explicit about what check I was talking 
about. The SocketRoutingQueue::DoRead() has the following code:

398 
<http://repo.or.cz/w/barry.git/blob/6c2ba5bdac6942cefb524224a6161cf19c2e288f:/src/router.cc#l398>
 
                 if( !dev->BulkRead(readEp, data, timeout) )
399 
<http://repo.or.cz/w/barry.git/blob/6c2ba5bdac6942cefb524224a6161cf19c2e288f:/src/router.cc#l399>
 
                         return; // no data, done!
400 
<http://repo.or.cz/w/barry.git/blob/6c2ba5bdac6942cefb524224a6161cf19c2e288f:/src/router.cc#l400>
 

401 
<http://repo.or.cz/w/barry.git/blob/6c2ba5bdac6942cefb524224a6161cf19c2e288f:/src/router.cc#l401>
 
                 MAKE_PACKET(pack, data);
402 
<http://repo.or.cz/w/barry.git/blob/6c2ba5bdac6942cefb524224a6161cf19c2e288f:/src/router.cc#l402>
 

403 
<http://repo.or.cz/w/barry.git/blob/6c2ba5bdac6942cefb524224a6161cf19c2e288f:/src/router.cc#l403>
 
                 // make sure the size is right
404 
<http://repo.or.cz/w/barry.git/blob/6c2ba5bdac6942cefb524224a6161cf19c2e288f:/src/router.cc#l404>
 
                 if( data.GetSize() < sizeof(pack->socket) )
405 
<http://repo.or.cz/w/barry.git/blob/6c2ba5bdac6942cefb524224a6161cf19c2e288f:/src/router.cc#l405>
 
                         return; // bad size, just skip


Which as sizeof(pack->socket) is 2 would cause reads of size 0 and 1 to 
be ignored. Should the new exception be thrown here instead of just 
returning, or should the new exception only be thrown if 0 bytes are read?

Regards,

Toby

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Barry-devel mailing list
Barry-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/barry-devel

Reply via email to