lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev Problem with HTLoadFile?


From: Klaus Weide
Subject: Re: lynx-dev Problem with HTLoadFile?
Date: Tue, 27 Jul 1999 09:57:56 -0500 (CDT)

On Tue, 27 Jul 1999 address@hidden wrote:

> Ok, I'm passing a URL to HTLoadFile in a custom protocol handler
> and it's going via FTP instead of HTTP for some reason.
> 
>     if (!new_arg) {
>         HTAlert(BAD_REQUEST);
>         status = -2;
>     } else {
>         status = HTLoadFile(new_arg, anAnchor, format_out, sink);
>         FREE(new_arg);
>     }
> 
> At the HTLoadFile call, new_arg="http://uk.comps.org/";.  What
> am I doing wrong?

It is expecting a file: URL there for access to local files (or
directories).  If it doesn't fine one, it passes control to
HTFTPLoad, since HTLoadFile is also used to handle ftp: URLs
(but doesn't do that directly).  See bottom of HTFile.c:
  GLOBALDEF PUBLIC HTProtocol HTFTP  = { "ftp", HTLoadFile, 0 };
  GLOBALDEF PUBLIC HTProtocol HTFile = { "file", HTLoadFile, HTFileSaveStream };
i.e. HTLoadFile gets registered for "ftp".  It probably has something
to do with file://remote.host/ falling back to "ftp" access.

Unless you want to mess around in HTLoadFile, doing you trick the
other way around might work: call HTLoadFile with a file URL in
addr (first arg), but pass it the anAnchor object for the non-file
URL.

   Klaus




reply via email to

[Prev in Thread] Current Thread [Next in Thread]