← Back to team overview

linuxdcpp-team team mailing list archive

[Bug 668548] [NEW] BufferedSocket::setDataMode -> infinite loop

 

Public bug reported:

if you call BufferedSocket::setDataMode with value that will be < left
(ie. what is actually read from socket at once) it will go to an
infinite loop, because when dataBytes have been read high will always
end up 0 even if left > 0.

What you, probably, want to do is break after firing ModeChange... (line
267).

Granted with dcpp's current usage this doesn't never happen afaik... I
stumbled on to this while adding support for chunked transfer encoding
(where the chunk size is often less than the read buffer) to
HttpConnection (to fix another would be bug, if server never sent
Content-Length thus resulting setDataMode being called with -1, and http
connection never properly completing).

** Affects: dcplusplus
     Importance: Undecided
         Status: New

-- 
BufferedSocket::setDataMode -> infinite loop
https://bugs.launchpad.net/bugs/668548
You received this bug notification because you are a member of
Dcplusplus-team, which is subscribed to DC++.

Status in DC++: New

Bug description:
if you call BufferedSocket::setDataMode with value that will be < left (ie. what is actually read from socket at once) it will go to an infinite loop, because when dataBytes have been read high will always end up 0 even if left > 0.

What you, probably, want to do is break after firing ModeChange... (line 267).

Granted with dcpp's current usage this doesn't never happen afaik... I stumbled on to this while adding support for chunked transfer encoding (where the chunk size is often less than the read buffer) to HttpConnection (to fix another would be bug, if server never sent Content-Length thus resulting setDataMode being called with -1, and http connection never properly completing).





Follow ups

References