From 76b42f6852d7ef7541cdccb54393c3624452916b Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Sat, 7 Sep 2013 15:52:31 -0400 Subject: [PATCH] Stuff --- mdl/m_fileio.pas | 34 ---------------------------------- mdl/m_tcp_client.pas | 4 ++++ mdl/m_tcp_client_ftp.pas | 12 +++++------- 3 files changed, 9 insertions(+), 41 deletions(-) diff --git a/mdl/m_fileio.pas b/mdl/m_fileio.pas index 9202fb7..b2b556a 100644 --- a/mdl/m_fileio.pas +++ b/mdl/m_fileio.pas @@ -35,7 +35,6 @@ Function FileCopy (Source, Target: String) : Boolean; Function FileFind (FN: String) : String; Function FileByteSize (FN: String) : Int64; Function FileNewExt (FN, NewExt: String) : String; -Procedure FileAppend (F1, F2: String); { GLOBAL FILEIO VARIABLES AND CONSTANTS } @@ -562,39 +561,6 @@ Begin Result := FN + '.' + NewExt; End; -Procedure FileAppend (F1, F2: String); -Var - BufIn, - BufOut : Array[1..8*1024] of Char; - TF1 : Text; - TF2 : Text; - Str : String; -Begin - Assign (TF1, F1); - - {$I-} Reset(TF1); {$I+} - - If IoResult <> 0 Then Exit; - - SetTextBuf (TF1, BufIn); - - Assign (TF2, F2); - {$I-} Append(TF2); {$I+} - - If (IoResult = 2) Then - ReWrite (TF2); - - SetTextBuf (TF2, BufOut); - - While Not Eof(TF1) Do Begin - ReadLn (TF1, Str); - WriteLn (TF2, Str); - End; - - Close (TF1); - Close (TF2); -End; - { FILE STREAMING FUNCTIONS } Constructor TFileBuffer.Create (BufferSize: LongInt); diff --git a/mdl/m_tcp_client.pas b/mdl/m_tcp_client.pas index db19f5d..14578d2 100644 --- a/mdl/m_tcp_client.pas +++ b/mdl/m_tcp_client.pas @@ -54,6 +54,8 @@ Begin If Client.FSocketHandle = -1 Then Exit; +WriteLn ('DEBUG SEND ' + Str); + Client.PurgeInputData(1); Client.WriteLine(Str); @@ -89,6 +91,8 @@ Begin Until Copy(Str, 1, 4) = strI2S(ResponseType) + ' '; End; End; + + writeln('DEBUG RECV ' + ResponseStr); End; End. diff --git a/mdl/m_tcp_client_ftp.pas b/mdl/m_tcp_client_ftp.pas index d68da94..2975332 100644 --- a/mdl/m_tcp_client_ftp.pas +++ b/mdl/m_tcp_client_ftp.pas @@ -75,16 +75,12 @@ Begin WaitSock.WaitInit(NetInterface, DataPort); - DataSocket := NIL; DataSocket := WaitSock.WaitConnection(10000); - If Not Assigned(DataSocket) Then Begin - WaitSock.Free; - - Exit; - End; - WaitSock.Free; + + If Not Assigned(DataSocket) Then + Exit; End; Result := True; @@ -164,6 +160,8 @@ Begin If Not FileExist(FileName) Then Exit; + WriteLn ('DEBUG SendFile Passive ', Passive, ' Filename ', FileName); + SetPassive(Passive); Client.WriteLine ('STOR ' + JustFile(FileName));