🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #2094

Re: Indy 9 TIdFTP EIdConnClosedGracefully etc.... (repost)

#2094
From: Skaarak
Date: Fri, 11 Aug 2006 15:29
110 lines
4978 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:44dbcbbb$1@newsgroups.borland.com...
>
> "Skaarak" <skaarak@NOakamailSPAM.com> wrote in message
> news:44dbb9a3$1@newsgroups.borland.com...
>
>> Still in the debugger, and even hitting 'Run' after closing the dialog 
>> box
>> (not an exception box, a program pop-up) does not cause it to continue.
>
> There are no popup messages in Indy.  "Connection Closed Gracefully" is an
> exception message.  If you are not seeing the debugger display an 
> exception
> popup for it, then your program has to be showing its own popup message,
> such as in an exception handler.  Or you are not catching any exceptions 
> and
> they are falling through to the VCL's default handler.
>
> Please show your actual code.  List() should not be throwing an 
> "Connection
> Closed Gracefully" exception, even with the ReadStream() fix applied.

Below are the "basics".  FTP2 is the TldFTP program. It calls the 
parsedirectory
function and that's what fails.  I've included the FormCreate function as 
well
so you can see what's in it.  The SaveLoad() just reads values from regestry
and puts them into a couple of edit boxes (unrelaed).
Stepping through the code I get to this line FTP2->List(RawDir->Items,"*", 
true);
int the ParseDirectory function before it fails and throws the Dialog Box.
-Cory

//---------------------------------------------------------------------------
void __fastcall TForm1::ConnectClick(TObject *Sender)
{
    int i;
    TStringList *names;
    if (!FTP2->Connected()) {
        FTP2->Host = Server->Text;
        FTP2->Username = UserName->Text;
        FTP2->Password = AdminForm->Decode(Password->Text);
        FTP2->Connect(true, 5000);

        if (FTP2->Connected()) {
            names = new TStringList ();
            FTP2->ChangeDir("AddOns");
            ParseDirectory (names, NULL, NULL, true);
            RemoteDir->Items = names;
            delete names;
        }
    }
}

//---------------------------------------------------------------------------
void __fastcall TForm1::ParseDirectory(TStringList *name, TStringList 
*directory, TStringList *size, bool dironly)
{
    int i;
    bool dir;
    AnsiString temp;
    RawDir->Clear();
    FTP2->List(RawDir->Items,"*", true);
    for (i=0; i<RawDir->Count; i++) {
        dir = false;
        temp = RawDir->Items->Strings[i].SubString(0,10);    //directory //0 
based I think (Index , COunt)
        if (temp.c_str()[0] == 'd' || temp.c_str()[0] == 'D') {
            dir = true;
        }
        if (directory != NULL) {
            if (dir || (!dironly)) {
                directory->Add(temp);
            }
        }
        temp = RawDir->Items->Strings[i].SubString(11,16);    //Unknown
        temp = RawDir->Items->Strings[i].SubString(27,16);    //Size
        if (size != NULL) {
            if (dir || (!dironly)) {
                size->Add(temp);
            }
        }
        temp = RawDir->Items->Strings[i].SubString(44,12);    //Date
        temp = RawDir->Items->Strings[i].SubString(57,99);    //Name
        if (name != NULL) {
            if (dir || (!dironly)) {
                name->Add(temp);
            }
        }
    }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
    AnsiString temp;
    this->Left = 100;
    this->Top = 100;
    this->ClientWidth = 800;
    this->ClientHeight = 600;

    temp.printf("Interface Assistant v%d.%02d.%02d", MAJOR_VERSION, 
MINOR_VERSION, VER_REV);
    Form1->Caption = temp;

    CurFile->Caption = "";
    Size->Caption = "";
    dt = NULL;

    SaveLoad (ID_LOAD);
}
Technical Details
Message-ID: <44dca1d2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44da0822$1@newsgroups.borland.com> <44da0c3a$1@newsgroups.borland.com> <44da527f@newsgroups.borland.com> <44da5f29$1@newsgroups.borland.com> <44da6c13$1@newsgroups.borland.com> <44da795d@newsgroups.borland.com> <44dbb9a3$1@newsgroups.borland.com> <44dbcbbb$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,cd863af49bc3aa8d
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Skaarak" <skaarak@NOakamailSPAM.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <44da0822$1@newsgroups.borland.com> <44da0c3a$1@newsgroups.borland.com> <44da527f@newsgroups.borland.com> <44da5f29$1@newsgroups.borland.com> <44da6c13$1@newsgroups.borland.com> <44da795d@newsgroups.borland.com> <44dbb9a3$1@newsgroups.borland.com> <44dbcbbb$1@newsgroups.borland.com>
Subject: Re: Indy 9 TIdFTP EIdConnClosedGracefully etc.... (repost)
Date: Fri, 11 Aug 2006 09:29:59 -0600
Lines: 112
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 63.231.79.30
Message-ID: <44dca1d2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1155310034 63.231.79.30 (11 Aug 2006 08:27:14 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail