mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed bug causing crash in pqistreamer
This commit is contained in:
parent
0bd66701ac
commit
1f7a94d49e
@ -546,13 +546,6 @@ int pqistreamer::handleoutgoing_locked()
|
||||
if(!dta)
|
||||
break ;
|
||||
|
||||
if(slice_size > 0xffff)
|
||||
{
|
||||
std::cerr << "(EE) protocol error in pqitreamer: slice size is too large and cannot be encoded." ;
|
||||
free(mPkt_wpending) ;
|
||||
mPkt_wpending_size = 0;
|
||||
}
|
||||
|
||||
if(slice_starts && slice_ends) // good old method. Send the packet as is, since it's a full packet.
|
||||
{
|
||||
#ifdef DEBUG_PACKET_SLICING
|
||||
@ -566,6 +559,13 @@ int pqistreamer::handleoutgoing_locked()
|
||||
}
|
||||
else // partial packet. We make a special header for it and insert it in the stream
|
||||
{
|
||||
if(slice_size > 0xffff || !mAcceptsPacketSlicing)
|
||||
{
|
||||
std::cerr << "(EE) protocol error in pqitreamer: slice size is too large and cannot be encoded." ;
|
||||
free(mPkt_wpending) ;
|
||||
mPkt_wpending_size = 0;
|
||||
return -1 ;
|
||||
}
|
||||
#ifdef DEBUG_PACKET_SLICING
|
||||
std::cerr << "sending partial slice, packet ID=" << std::hex << slice_packet_id << std::dec << ", size=" << slice_size << std::endl;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user