On 7/25/2011 7:46 PM, Mike Eriksen wrote:
> Maybe a stupid idea, but couldn't HTGet just call you FTP client in
> case of a FTP-URL and let that one handle the download and keep the
> rest inside HTGet?
>
> Mike

There is no simple "call" ...  the FTP client is a stand-alone program.  
In the event of a "301 Moved Permanently" HTTP response one could parse 
the new URI, figure out it is FTP, and build a script to use with the 
FTP client.  The scripting support in the FTP client is minimal at the 
moment and there is no support for driving the script using a 
programming language of any type, so errors would be impossible to 
detect and recover from.  FTP is also inherently more complex - you have 
active and passive mode to deal with, multiple sockets at the same time, 
user firewall problems, etc.

One could repackage the FTP client code as a callable/linkable library 
that provides a simple FTP "get" or "put" type function.  That would 
make it easier to integrate into something htget.  It would also make 
htget far bigger too ...

One could also expand the scripting capability of the standalone FTP 
client so that external scripts that could react to error conditions 
could be developed.  That would make it easier for the htget program to 
use the existing client and control it in an intelligent manner.

I think both approaches have merit - one provides building blocks that 
can be incorporated into other programs.  The other enhances the ability 
of the existing client to run in an automated way.

On a philosophical note, HTGet was purpose built to talk to HTTP 
servers.  Most people start with a known good URL, so a 301 is unusual.  
And a 301 that redirects to an entirely different protocol is even more 
unusual.  Coding for the worst case scenario makes the code bigger, 
buggier, and slower for the 95% of the time when the error is not going 
to be encountered ...  for the 5% of time when something like this 
happens, some form of human interaction to switch to the FTP client or 
fix the server is not totally unwarranted.

On a side note, a custom built updater for FreeDOS using HTTP would be 
interesting.  (HTTP is far easier to work with because the responses are 
parseable and there is only one socket to deal with, which is always 
outgoing from the client point of view.)

And there is always wget, which is quite a bit more versatile but bigger ...


Mike



------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to