Hi all,
I'm having trouble with a lengthy filetransfer operation.
It seems that after a long period of transmitting the sock.Sendbuffer does not
return.
FcurrentState is monitored from outside the thread and stops at 'ft-send'.
The client detects a timeout and restarts the operation, thus forcing a new
thread to be created, but the original thread is stuck.
BandwitdhLimitation is off
Software is running on RedHat Enterprise Server and is compiled with FPC 2.2
Can anyone help me out of this ??
Here's the code
...
if Assigned(movStream) then
begin
try
Cipher := tDCP_Rijndael.Create(nil);
Cipher.InitStr(CipherInitStr, tDCP_sha1);
Cipher.CipherMode := cmCFB8bit;
Logout('starting...');
FCurrentState := 'filetransfer';
FCurrentPos := 0;
FCurrentTotal := movStream.Size;
FCurrentBytes := movStream.Position;
repeat
FCurrentState := 'ft-read';
len := movStream.Read(buffer, SizeOf(buffer));
if len > 0 then
begin
FCurrentState := 'ft-cipher';
Cipher.Encrypt(buffer, buffer, len);
FCurrentState := 'ft-send';
sock.SendBuffer(@buffer, len);
FCurrentBytes := FCurrentBytes + len;
FCurrentPos := (FCurrentBytes * 100) div FCurrentTotal;
end;
until (len <= 0) or (sock.lasterror <> 0);
FCurrentState := 'ft-close';
finally
FreeAndNil(movStream);
Cipher.Free;
end;
FCurrentState := 'ft-cleanup';
end;
Thomas Kerkmann
Senior Software Developer
Acentic GmbH
Venloer Straße 151-153
50672 Köln
Tel. +49 221 76802-430
Fax +49 221 76802-123
[email protected]
www.acentic.com
Sitz der Gesellschaft / Registergericht: Köln, HRB 51944, Steuernummer:
215/5800/1882
Geschäftsführung: Alistair R.B. Forbes, Roger Crellin, Richard Robinson, Stuart
Radcliffe, Vorsitzender des Aufsichtsrates: Dr. Phil Kaziewicz
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht
gestattet.
This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any unauthorised
copying, disclosure or distribution of the material in this e-mail is strictly
forbidden.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public