🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Go from Indy 9 to Indy 8

#2007
From: Skaarak
Date: Tue, 05 Sep 2006 16:28
126 lines
5358 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:44f8b9ba@newsgroups.borland.com...
> "Skaarak" <skaarak@NOakamailSPAM.com> wrote in message
> news:44f8ae89$1@newsgroups.borland.com...
>
>> Because I cannot get Indy 9 to work at all
> Why not?  You need to be more specific.  Indy 9 works fine for me.

I wish I knew.  Having been in here a few times trying to fix it.  Wish
it went in as easily as the rest of the installs.

>> So while this is very likely my problem, to me, Indy 9 is worthless
>> if I cannot get it to work.
> Then you need to explain what exactly is not working for you.

As per my post about a month ago:
Indy 9 TIdFTP EIdConnClosedGracefully etc...
It is still throwing that disconnect.
I don't see how it the server could be throwing it since it never has
before and lets me in via other means.

Here's the code again:

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

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

//---------------------------------------------------------------------------
void __fastcall TForm1::ParseDirectory(TStringList *name, TStringList 
*directory, TStringList *size, bool dironly)
{
    int i;
    bool dir;
    AnsiString temp;
    RawDir->Clear();

    try {
        FTP2->List(RawDir->Items,"*", true);
    } catch(const Exception &) {
        return;    // Every time w/o fail this Exception is thrown!
    }

    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);
            }
        }
    }
}

************************************************************
The exception on the "FTP2->List(RawDir->Items,"*", true);" is thrown
every time (the closed gracefully one when I let it through) and the program
grinds to a screeching halt.
Thinking that maybe it was because this was because I went from Indy 8 to 9
and had a few pieces left over, I created a projecte from scratch and the
same error in the same place occured.
This same code worked in 8, but that FTP2-> List seems to be bugged.  I did
put in your TCP fix which allowed it to throw an exception (instead of 
stalling)
but I'm still stuck.


>> I really only tried Indy 9 to get a MD5 hash, and now I am regretting
>> that I ever tried.
> Why?

Because I could really use a nice FTP interface and Indy9 isn't working
for me, I can't seem to get it working (though I'll keep trying) and there 
is
no way (easy way) to go back to Indy 8 where I had it up and working
really nice.

>> Even starting a Indy 9 project from scratch it still has that
>> same "Connection exits gracefully" crap.
> Are you using the latest 9.0.50 snapshot?  I have not run into that 
> problem.

Yes, Indy 9.0.50 snapshot w/ 9.0.17 RSP I think.

-Cory 
Technical Details
Message-ID: <44fda587$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.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: <44f86696$1@newsgroups.borland.com> <44f89ea5$1@newsgroups.borland.com> <44f8ae89$1@newsgroups.borland.com> <44f8b9ba@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f4215290349cd894
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Skaarak" <skaarak@NOakamailSPAM.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <44f86696$1@newsgroups.borland.com> <44f89ea5$1@newsgroups.borland.com> <44f8ae89$1@newsgroups.borland.com> <44f8b9ba@newsgroups.borland.com>
Subject: Re: Go from Indy 9 to Indy 8
Date: Tue, 5 Sep 2006 10:28:02 -0600
Lines: 128
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.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 63.231.79.30
Message-ID: <44fda587$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1157473671 63.231.79.30 (5 Sep 2006 09:27:51 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.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