[twsocket] FTPSERV demo modified under BCB5 passive mode problems.

Raptor G g_ates@hotmail.com
Sun, 25 Jun 2000 13:13:54 EEST


This is a multi-part message in MIME format.

------=_NextPart_000_6fe3c690_2cdc4626$62b86a2b
Content-Type: text/plain; format=flowed

Hi,

As a holiday exercise, today I decided to write read-only ftp server using 
the ICS ftp server demo. I have added the functionality of selecting home 
directory and disabled everything but directory listing and get using the 
validate events. I do not see anyplace where I disabled Passive mode.

The compiled version available at: http://www.fastream.com/FTPSERV.zip

I cannot post the full source because the path selection part requires 
plasmatech components.

Now the problem is, using the windows dos-ftp, when I switch to passive mode 
and send a list command, it freezes! (The client freezes, and when I end the 
task of the client, server continues to work.)

I am attaching the modified main form cpp file. If anyone can figure this 
out, I am planning a read-only ftp server in my ftp client which would 
enable napster like activity when used with the client together. Also I am 
planning a dynip/monolith poster for dynamic ip situations. This way I hope 
to have a chance to emulate the napsters directory service. Maybe I am too 
optimistic but with ICS it is so easy!

Regards,

RaptorG
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

------=_NextPart_000_6fe3c690_2cdc4626$62b86a2b
Content-Type: application/octet-stream; name="FtpSrv1.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="FtpSrv1.cpp"

LyogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICog
KiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKg0KDQpBdXRob3I6ICAg
ICAgIEZyYW7nb2lzIFBJRVRURQ0KRGVzY3JpcHRpb246ICBUaGlzIGlzIGEg
ZGVtbyBwcm9ncmFtIHNob3dpbmcgaG93IHRvIHVzZSB0aGUgVEZ0cFNlcnZl
cg0KICAgICAgICAgICAgICBjb21wb25lbnQgdG8gYnVpbGQgYSBGVFAgc2Vy
dmVyLg0KQ3JlYXRpb246ICAgICBEZWMgMTksIDE5OTggKFRyYW5zbGF0ZWQg
ZnJvbSBEZWxwaGkgdmVyc2lvbikNClZlcnNpb246ICAgICA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