/* This file, drvrhttp.c contains driver routines for http, ftp and root files. */ /* This file was written by Bruce O'Neel at the ISDC, Switzerland */ /* The FITSIO software is maintained by William Pence at the High Energy */ /* Astrophysic Science Archive Research Center (HEASARC) at the NASA */ /* Goddard Space Flight Center. */ /* Notes on the drivers: The ftp driver uses passive mode exclusivly. If your remote system can't deal with passive mode then it'll fail. Since Netscape Navigator uses passive mode as well there shouldn't be too many ftp servers which have problems. The http driver works properly with 301 and 302 redirects. For many more gory details see http://www.w3c.org/Protocols/rfc2068/rfc2068. The only catch to the 301/302 redirects is that they have to redirect to another http:// url. If not, things would have to change a lot in cfitsio and this was thought to be too difficult. Redirects look like
This redirect was from apache 1.2.5 but most of the other servers produce
something very similiar. The parser for the redirects finds the first
anchor tag in the body and goes there. If that wasn't what was intended
by the remote system then hopefully the error stack, which includes notes
about the redirect will help the user fix the problem.
Root protocal doesn't have any real docs, so, the emperical docs are as
follows.
First, you must use a slightly modified rootd server. The modifications
include implimentation of the stat command which returns the size of the
remote file. Without that it's impossible for cfitsio to work properly
since fitsfiles don't include any information about the size of the files
in the headers. The rootd server closes the connections on any errors,
including reading beyond the end of the file or seeking beyond the end
of the file. The rootd:// driver doesn't reopen a closed connection, if
the connection is closed you're pretty much done.
The messages are of the form