[twsocket] TFtpCli V6 Bug truncated files upon download

2006-09-18 Thread Arno Garrels
Hi, TFtpCli V6 truncates downloaded files. I found that wsoNoReceiveLoop causes ASyncReceive() to break even though there is still data pending. When I set SocketOptions of the datasocket to [] downloads work fine. Any idea why v5 and v6 behave so different? Is this a possible bug in TWsocket?

Re: [twsocket] TFtpCli V6 Bug truncated files upon download

2006-09-18 Thread Francois Piette
Strange. Is it totally reproductible ? Or does it occur only ocassinally ? Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be

Re: [twsocket] TFtpCli V6 Bug truncated files upon download

2006-09-18 Thread Arno Garrels
Francois Piette wrote: > Strange. > Is it totally reproductible ? Or does it occur only ocassinally ? It is totally reproducible! The FD_CLOSE message arrives far before all data has been read causing ASyncReceive() to break the receive loop too early. > > Contribute to the SSL Effort. Visit >

Re: [twsocket] TFtpCli V6 Bug truncated files upon download

2006-09-18 Thread Arno Garrels
Arno Garrels wrote: > Francois Piette wrote: >> Strange. >> Is it totally reproductible ? Or does it occur only ocassinally ? > > It is totally reproducible! The FD_CLOSE message arrives far before > all data has been read causing ASyncReceive() to break the receive > loop too early. I wonder why

Re: [twsocket] TFtpCli V6 Bug truncated files upon download

2006-09-18 Thread Arno Garrels
The bug is in procedure TCustomWSocket.ASyncReceive( Error : Word; MySocketOptions : TWSocketOptions); [..] { DLR Honor the socket options being passed as parameters } if HasOption(FComponentOptions, wsoNoReceiveLoop) then break; [..] should be: { DLR Honor the socket op

Re: [twsocket] TFtpCli V6 Bug truncated files upon download

2006-09-18 Thread Arno Garrels
Arno Garrels wrote: > The bug is in > procedure TCustomWSocket.ASyncReceive( > Error : Word; > MySocketOptions : TWSocketOptions); > [..] > { DLR Honor the socket options being passed as parameters } > if HasOption(FComponentOptions, wsoNoReceiveLoop) then > break; > > [..

Re: [twsocket] TFtpCli V6 Bug truncated files upon download

2006-09-18 Thread Arno Garrels
I was a bit confused by the name MySocketOptions. So the fix is: procedure TCustomWSocket.ASyncReceive() [..] { DLR Honor the socket options being passed as parameters } if wsoNoReceiveLoop in MySocketOptions then break; [..] Arno Garrels wrote: > The bug is in > procedure TCustomWSocket.AS