1998-07-09 16:52:44 +00:00
|
|
|
|
.\" Copyright (c) 1998 Dag-Erling Co<43>dan Sm<53>rgrav
|
|
|
|
|
.\" All rights reserved.
|
|
|
|
|
.\"
|
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
|
.\" are met:
|
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
|
.\"
|
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
|
.\" $FreeBSD$
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.\"
|
|
|
|
|
.Dd July 1, 1998
|
|
|
|
|
.Dt FETCH 3
|
|
|
|
|
.Os
|
|
|
|
|
.Sh NAME
|
2000-05-25 16:46:09 +00:00
|
|
|
|
.Nm fetchMakeURL ,
|
2000-05-11 13:31:02 +00:00
|
|
|
|
.Nm fetchParseURL ,
|
|
|
|
|
.Nm fetchFreeURL ,
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Nm fetchXGetURL ,
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Nm fetchGetURL ,
|
|
|
|
|
.Nm fetchPutURL ,
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Nm fetchStatURL ,
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Nm fetchListURL ,
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Nm fetchXGet ,
|
1998-09-26 20:42:44 +00:00
|
|
|
|
.Nm fetchGet ,
|
|
|
|
|
.Nm fetchPut ,
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Nm fetchStat ,
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Nm fetchList ,
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Nm fetchXGetFile ,
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Nm fetchGetFile ,
|
|
|
|
|
.Nm fetchPutFile ,
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Nm fetchStatFile ,
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Nm fetchListFile ,
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Nm fetchXGetHTTP ,
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Nm fetchGetHTTP ,
|
|
|
|
|
.Nm fetchPutHTTP ,
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Nm fetchStatHTTP ,
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Nm fetchListHTTP ,
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Nm fetchXGetFTP ,
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Nm fetchGetFTP ,
|
2000-04-22 16:08:41 +00:00
|
|
|
|
.Nm fetchPutFTP ,
|
|
|
|
|
.Nm fetchStatFTP ,
|
|
|
|
|
.Nm fetchListFTP
|
|
|
|
|
.Nd file transfer functions
|
|
|
|
|
.Sh LIBRARY
|
|
|
|
|
.Lb libfetch
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Sh SYNOPSIS
|
1998-12-16 10:24:55 +00:00
|
|
|
|
.Fd #include <sys/param.h>
|
|
|
|
|
.Fd #include <stdio.h>
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Fd #include <fetch.h>
|
2000-05-11 13:31:02 +00:00
|
|
|
|
.Ft struct url *
|
2000-05-25 16:46:09 +00:00
|
|
|
|
.Fn fetchMakeURL "char *scheme" "char *host" "int port" "char *doc" "char *user" "char *pwd"
|
|
|
|
|
.Ft struct url *
|
2000-05-11 13:31:02 +00:00
|
|
|
|
.Fn fetchParseURL "char *URL"
|
|
|
|
|
.Ft void
|
|
|
|
|
.Fn fetchFreeURL "struct url *URL"
|
1998-09-26 20:42:44 +00:00
|
|
|
|
.Ft FILE *
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetURL "char *URL" "struct url_stat *us" "char *flags"
|
|
|
|
|
.Ft FILE *
|
1998-09-26 20:42:44 +00:00
|
|
|
|
.Fn fetchGetURL "char *URL" "char *flags"
|
|
|
|
|
.Ft FILE *
|
|
|
|
|
.Fn fetchPutURL "char *URL" "char *flags"
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Ft int
|
|
|
|
|
.Fn fetchStatURL "char *URL" "struct url_stat *us" "char *flags"
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Ft struct url_ent *
|
|
|
|
|
.Fn fetchListURL "char *URL" "char *flags"
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Ft FILE *
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGet "struct url *URL" "struct url_stat *us" "char *flags"
|
|
|
|
|
.Ft FILE *
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchGet "struct url *URL" "char *flags"
|
1998-09-26 20:42:44 +00:00
|
|
|
|
.Ft FILE *
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchPut "struct url *URL" "char *flags"
|
|
|
|
|
.Ft int
|
|
|
|
|
.Fn fetchStat "struct url *URL" "struct url_stat *us" "char *flags"
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Ft struct url_ent *
|
|
|
|
|
.Fn fetchList "struct url *" "char *flags"
|
1998-09-26 20:42:44 +00:00
|
|
|
|
.Ft FILE *
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetFile "struct url *u" "struct url_stat *us" "char *flags"
|
|
|
|
|
.Ft FILE *
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchGetFile "struct url *u" "char *flags"
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Ft FILE *
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchPutFile "struct url *u" "char *flags"
|
|
|
|
|
.Ft int
|
|
|
|
|
.Fn fetchStatFile "struct url *URL" "struct url_stat *us" "char *flags"
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Ft struct url_ent *
|
|
|
|
|
.Fn fetchListFile "struct url *" "char *flags"
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Ft FILE *
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetHTTP "struct url *u" "struct url_stat *us" "char *flags"
|
|
|
|
|
.Ft FILE *
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchGetHTTP "struct url *u" "char *flags"
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Ft FILE *
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchPutHTTP "struct url *u" "char *flags"
|
|
|
|
|
.Ft int
|
|
|
|
|
.Fn fetchStatHTTP "struct url *URL" "struct url_stat *us" "char *flags"
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Ft struct url_ent *
|
|
|
|
|
.Fn fetchListHTTP "struct url *" "char *flags"
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Ft FILE *
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetFTP "struct url *u" "struct url_stat *us" "char *flags"
|
|
|
|
|
.Ft FILE *
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchGetFTP "struct url *u" "char *flags"
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Ft FILE *
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchPutFTP "struct url *u" "char *flags"
|
|
|
|
|
.Ft int
|
|
|
|
|
.Fn fetchStatFTP "struct url *URL" "struct url_stat *us" "char *flags"
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Ft struct url_ent *
|
|
|
|
|
.Fn fetchListFTP "struct url *" "char *flags"
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Sh DESCRIPTION
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Pp
|
1998-07-09 16:52:44 +00:00
|
|
|
|
These functions implement a high-level library for retrieving and
|
|
|
|
|
uploading files using Uniform Resource Locators (URLs).
|
|
|
|
|
.Pp
|
2000-05-11 13:31:02 +00:00
|
|
|
|
.Fn fetchParseURL
|
|
|
|
|
takes a URL in the form of a null-terminated string and splits it into
|
|
|
|
|
its components function according to the Common Internet Scheme Syntax
|
2000-05-11 15:22:52 +00:00
|
|
|
|
detailed in RFC1738.
|
|
|
|
|
A regular expression which produces this syntax is:
|
2000-05-11 13:31:02 +00:00
|
|
|
|
.Bd -literal
|
|
|
|
|
<scheme>:(//(<user>(:<pwd>)?@)?<host>(:<port>)?)?/(<document>)?
|
|
|
|
|
.Ed
|
|
|
|
|
.Pp
|
2000-10-12 22:11:26 +00:00
|
|
|
|
If the URL does not seem to begin with a scheme name, the following
|
|
|
|
|
syntax is assumed:
|
|
|
|
|
.Bd -literal
|
|
|
|
|
((<user>(:<pwd>)?@)?<host>(:<port>)?)?/(<document>)?
|
|
|
|
|
.Ed
|
|
|
|
|
.Pp
|
2000-05-11 13:31:02 +00:00
|
|
|
|
Note that some components of the URL are not necessarily relevant to
|
|
|
|
|
all URL schemes.
|
2000-10-12 22:11:26 +00:00
|
|
|
|
For instance, the file scheme only needs the <scheme> and <document>
|
|
|
|
|
components.
|
2000-05-11 13:31:02 +00:00
|
|
|
|
.Pp
|
2000-05-25 16:46:09 +00:00
|
|
|
|
.Fn fetchMakeURL
|
|
|
|
|
and
|
2000-05-15 08:34:42 +00:00
|
|
|
|
.Fn fetchParseURL
|
2000-05-25 16:46:09 +00:00
|
|
|
|
return a pointer to a
|
2000-05-15 08:34:42 +00:00
|
|
|
|
.Fa url
|
|
|
|
|
structure, which is defined as follows in
|
|
|
|
|
.Aq Pa fetch.h :
|
|
|
|
|
.Bd -literal
|
|
|
|
|
#define URL_SCHEMELEN 16
|
|
|
|
|
#define URL_USERLEN 256
|
|
|
|
|
#define URL_PWDLEN 256
|
|
|
|
|
|
|
|
|
|
struct url {
|
|
|
|
|
char scheme[URL_SCHEMELEN+1];
|
|
|
|
|
char user[URL_USERLEN+1];
|
|
|
|
|
char pwd[URL_PWDLEN+1];
|
|
|
|
|
char host[MAXHOSTNAMELEN+1];
|
|
|
|
|
int port;
|
|
|
|
|
char *doc;
|
|
|
|
|
off_t offset;
|
|
|
|
|
size_t length;
|
|
|
|
|
};
|
|
|
|
|
.Ed
|
|
|
|
|
.Pp
|
2000-05-11 13:31:02 +00:00
|
|
|
|
The pointer returned by
|
2000-05-25 16:46:09 +00:00
|
|
|
|
.Fn fetchMakeURL
|
|
|
|
|
or
|
2000-05-11 13:31:02 +00:00
|
|
|
|
.Fn fetchParseURL
|
|
|
|
|
should be freed using
|
|
|
|
|
.Fn fetchFreeURL .
|
|
|
|
|
.Pp
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetURL ,
|
|
|
|
|
.Fn fetchGetURL ,
|
1998-09-26 20:42:44 +00:00
|
|
|
|
and
|
|
|
|
|
.Fn fetchPutURL
|
|
|
|
|
constitute the recommended interface to the
|
|
|
|
|
.Nm fetch
|
2000-03-02 09:14:21 +00:00
|
|
|
|
library.
|
|
|
|
|
They examine the URL passed to them to determine the transfer
|
1998-09-26 20:42:44 +00:00
|
|
|
|
method, and call the appropriate lower-level functions to perform the
|
2000-03-02 09:14:21 +00:00
|
|
|
|
actual transfer.
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetURL
|
|
|
|
|
also returns the remote document's metadata in the
|
|
|
|
|
.Fa url_stat
|
|
|
|
|
structure pointed to by the
|
|
|
|
|
.Fa us
|
|
|
|
|
argument.
|
|
|
|
|
.Pp
|
2000-03-02 09:14:21 +00:00
|
|
|
|
The
|
1998-09-26 20:42:44 +00:00
|
|
|
|
.Fa flags
|
2000-03-02 09:14:21 +00:00
|
|
|
|
argument is a string of characters which specify transfer options.
|
|
|
|
|
The
|
1998-09-26 20:42:44 +00:00
|
|
|
|
meaning of the individual flags is scheme-dependent, and is detailed
|
|
|
|
|
in the appropriate section below.
|
|
|
|
|
.Pp
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchStatURL
|
|
|
|
|
attempts to obtain the requested document's metadata and fill in the
|
2000-03-02 09:14:21 +00:00
|
|
|
|
structure pointed to by it's second argument.
|
|
|
|
|
The
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fa url_stat
|
|
|
|
|
structure is defined as follows in
|
|
|
|
|
.Aq Pa fetch.h :
|
|
|
|
|
.Bd -literal
|
|
|
|
|
struct url_stat {
|
|
|
|
|
off_t size;
|
1998-12-16 15:29:03 +00:00
|
|
|
|
time_t atime;
|
|
|
|
|
time_t mtime;
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
};
|
|
|
|
|
.Ed
|
|
|
|
|
.Pp
|
2000-05-15 08:34:42 +00:00
|
|
|
|
If the size could not be obtained from the server, the
|
|
|
|
|
.Fa size
|
|
|
|
|
field is set to -1.
|
|
|
|
|
If the modification time could not be obtained from the server, the
|
|
|
|
|
.Fa mtime
|
|
|
|
|
field is set to the epoch.
|
|
|
|
|
If the access time could not be obtained from the server, the
|
|
|
|
|
.Fa atime
|
|
|
|
|
field is set to the modification time.
|
|
|
|
|
.Pp
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Fn fetchListURL
|
|
|
|
|
attempts to list the contents of the directory pointed to by the URL
|
2000-03-02 09:14:21 +00:00
|
|
|
|
provided.
|
|
|
|
|
If successful, it returns a malloced array of
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Fa url_ent
|
2000-03-02 09:14:21 +00:00
|
|
|
|
structures.
|
|
|
|
|
The
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Fa url_ent
|
|
|
|
|
structure is defined as follows in
|
|
|
|
|
.Aq Pa fetch.h :
|
|
|
|
|
.Bd -literal
|
|
|
|
|
struct url_ent {
|
|
|
|
|
char name[MAXPATHLEN];
|
|
|
|
|
struct url_stat stat;
|
|
|
|
|
};
|
|
|
|
|
.Ed
|
|
|
|
|
.Pp
|
|
|
|
|
The list is terminated by an entry with an empty name.
|
|
|
|
|
.Pp
|
|
|
|
|
The pointer returned by
|
|
|
|
|
.Fn fetchListURL
|
|
|
|
|
should be freed using
|
|
|
|
|
.Fn free .
|
|
|
|
|
.Pp
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGet ,
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchGet ,
|
1998-09-26 20:42:44 +00:00
|
|
|
|
.Fn fetchPut
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
and
|
|
|
|
|
.Fn fetchStat
|
1998-09-26 20:42:44 +00:00
|
|
|
|
are similar to
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetURL ,
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchGetURL ,
|
|
|
|
|
.Fn fetchPutURL
|
1998-07-09 16:52:44 +00:00
|
|
|
|
and
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fn fetchStatURL ,
|
1998-09-26 20:42:44 +00:00
|
|
|
|
except that they expect a pre-parsed URL in the form of a pointer to
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
a
|
|
|
|
|
.Fa struct url
|
|
|
|
|
rather than a string.
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Pp
|
|
|
|
|
All of the
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetXXX ,
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Fn fetchGetXXX
|
|
|
|
|
and
|
|
|
|
|
.Fn fetchPutXXX
|
|
|
|
|
functions return a pointer to a stream which can be used to read or
|
2000-03-02 09:14:21 +00:00
|
|
|
|
write data from or to the requested document, respectively.
|
|
|
|
|
Note that
|
1998-07-09 16:52:44 +00:00
|
|
|
|
although the implementation details of the individual access methods
|
|
|
|
|
vary, it can generally be assumed that a stream returned by one of the
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetXXX
|
|
|
|
|
or
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Fn fetchGetXXX
|
|
|
|
|
functions is read-only, and that a stream returned by one of the
|
|
|
|
|
.Fn fetchPutXXX
|
|
|
|
|
functions is write-only.
|
|
|
|
|
.Sh FILE SCHEME
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetFile ,
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Fn fetchGetFile
|
|
|
|
|
and
|
|
|
|
|
.Fn fetchPutFile
|
|
|
|
|
provide access to documents which are files in a locally mounted file
|
2000-03-02 09:14:21 +00:00
|
|
|
|
system.
|
|
|
|
|
Only the <document> component of the URL is used.
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Pp
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetFile
|
|
|
|
|
and
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Fn fetchGetFile
|
2000-07-17 21:25:00 +00:00
|
|
|
|
do not accept any flags.
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Pp
|
|
|
|
|
.Fn fetchPutFile
|
|
|
|
|
accepts the
|
|
|
|
|
.Fa a
|
2000-03-02 09:14:21 +00:00
|
|
|
|
(append to file) flag.
|
|
|
|
|
If that flag is specified, the data written to
|
1998-07-09 16:52:44 +00:00
|
|
|
|
the stream returned by
|
|
|
|
|
.Fn fetchPutFile
|
|
|
|
|
will be appended to the previous contents of the file, instead of
|
|
|
|
|
replacing them.
|
|
|
|
|
.Sh FTP SCHEME
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetFTP ,
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Fn fetchGetFTP
|
|
|
|
|
and
|
|
|
|
|
.Fn fetchPutFTP
|
|
|
|
|
implement the FTP protocol as described in RFC959.
|
|
|
|
|
.Pp
|
|
|
|
|
If the
|
|
|
|
|
.Fa p
|
|
|
|
|
(passive) flag is specified, a passive (rather than active) connection
|
|
|
|
|
will be attempted.
|
|
|
|
|
.Pp
|
2000-01-07 10:59:12 +00:00
|
|
|
|
If the
|
|
|
|
|
.Fa h
|
|
|
|
|
(high) flag is specified, data sockets will be allocated in the high
|
|
|
|
|
port range (see
|
2001-01-16 09:08:22 +00:00
|
|
|
|
.Xr ip 4 ) .
|
2000-01-07 10:59:12 +00:00
|
|
|
|
.Pp
|
|
|
|
|
If the
|
|
|
|
|
.Fa d
|
|
|
|
|
(direct) flag is specified,
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetFTP ,
|
2000-01-07 10:59:12 +00:00
|
|
|
|
.Fn fetchGetFTP
|
|
|
|
|
and
|
|
|
|
|
.Fn fetchPutFTP
|
|
|
|
|
will use a direct connection even if a proxy server is defined.
|
|
|
|
|
.Pp
|
1998-07-09 16:52:44 +00:00
|
|
|
|
If no user name or password is given, the
|
|
|
|
|
.Nm fetch
|
2001-01-08 13:46:40 +00:00
|
|
|
|
library will attempt an anonymous login, with user name "anonymous"
|
|
|
|
|
and password "anonymous@<hostname>".
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Sh HTTP SCHEME
|
|
|
|
|
The
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetHTTP ,
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Fn fetchGetHTTP
|
|
|
|
|
and
|
|
|
|
|
.Fn fetchPutHTTP
|
2000-03-02 09:14:21 +00:00
|
|
|
|
functions implement the HTTP/1.1 protocol.
|
|
|
|
|
With a little luck, there's
|
1998-07-09 16:52:44 +00:00
|
|
|
|
even a chance that they comply with RFC2068.
|
|
|
|
|
.Pp
|
2000-01-07 10:59:12 +00:00
|
|
|
|
If the
|
|
|
|
|
.Fa d
|
|
|
|
|
(direct) flag is specified,
|
2000-07-17 21:25:00 +00:00
|
|
|
|
.Fn fetchXGetHTTP ,
|
2000-01-07 10:59:12 +00:00
|
|
|
|
.Fn fetchGetHTTP
|
|
|
|
|
and
|
|
|
|
|
.Fn fetchPutHTTP
|
|
|
|
|
will use a direct connection even if a proxy server is defined.
|
|
|
|
|
.Pp
|
1998-07-09 16:52:44 +00:00
|
|
|
|
Since there seems to be no good way of implementing the HTTP PUT
|
|
|
|
|
method in a manner consistent with the rest of the
|
|
|
|
|
.Nm fetch
|
|
|
|
|
library,
|
|
|
|
|
.Fn fetchPutHTTP
|
|
|
|
|
is currently unimplemented.
|
|
|
|
|
.Sh RETURN VALUES
|
|
|
|
|
.Fn fetchParseURL
|
|
|
|
|
returns a pointer to a
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.Fa struct url
|
2000-03-02 09:14:21 +00:00
|
|
|
|
containing the individual components of the URL.
|
|
|
|
|
If it is
|
1998-07-09 16:52:44 +00:00
|
|
|
|
unable to allocate memory, or the URL is syntactically incorrect,
|
|
|
|
|
.Fn fetchParseURL
|
|
|
|
|
returns a NULL pointer.
|
|
|
|
|
.Pp
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
The
|
|
|
|
|
.Fn fetchStat
|
|
|
|
|
functions return 0 on success and -1 on failure.
|
|
|
|
|
.Pp
|
1998-07-09 16:52:44 +00:00
|
|
|
|
All other functions return a stream pointer which may be used to
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
access the requested document, or NULL if an error occurred.
|
|
|
|
|
.Pp
|
2000-05-25 16:24:31 +00:00
|
|
|
|
The following error codes are defined in
|
|
|
|
|
.Aq Pa fetch.h :
|
2000-04-22 16:08:41 +00:00
|
|
|
|
.Bl -tag -width 18n
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.It Bq Er FETCH_ABORT
|
|
|
|
|
Operation aborted
|
|
|
|
|
.It Bq Er FETCH_AUTH
|
|
|
|
|
Authentication failed
|
|
|
|
|
.It Bq Er FETCH_DOWN
|
|
|
|
|
Service unavailable
|
|
|
|
|
.It Bq Er FETCH_EXISTS
|
|
|
|
|
File exists
|
|
|
|
|
.It Bq Er FETCH_FULL
|
|
|
|
|
File system full
|
|
|
|
|
.It Bq Er FETCH_INFO
|
|
|
|
|
Informational response
|
|
|
|
|
.It Bq Er FETCH_MEMORY
|
|
|
|
|
Insufficient memory
|
|
|
|
|
.It Bq Er FETCH_MOVED
|
|
|
|
|
File has moved
|
|
|
|
|
.It Bq Er FETCH_NETWORK
|
|
|
|
|
Network error
|
|
|
|
|
.It Bq Er FETCH_OK
|
|
|
|
|
No error
|
|
|
|
|
.It Bq Er FETCH_PROTO
|
|
|
|
|
Protocol error
|
|
|
|
|
.It Bq Er FETCH_RESOLV
|
|
|
|
|
Resolver error
|
|
|
|
|
.It Bq Er FETCH_SERVER
|
|
|
|
|
Server error
|
|
|
|
|
.It Bq Er FETCH_TEMP
|
|
|
|
|
Temporary error
|
|
|
|
|
.It Bq Er FETCH_TIMEOUT
|
|
|
|
|
Operation timed out
|
|
|
|
|
.It Bq Er FETCH_UNAVAIL
|
|
|
|
|
File is not available
|
|
|
|
|
.It Bq Er FETCH_UNKNOWN
|
|
|
|
|
Unknown error
|
|
|
|
|
.It Bq Er FETCH_URL
|
|
|
|
|
Invalid URL
|
|
|
|
|
.El
|
|
|
|
|
.Pp
|
|
|
|
|
The accompanying error message includes a protocol-specific error code
|
|
|
|
|
and message, e.g. "File is not available (404 Not Found)"
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Sh ENVIRONMENT
|
2000-10-29 12:58:08 +00:00
|
|
|
|
.Bl -tag -width FTP_PASSIVE_MODE
|
2000-12-22 18:03:21 +00:00
|
|
|
|
.It Ev FTP_LOGIN
|
|
|
|
|
Default FTP login if none was provided in the URL.
|
2000-10-29 12:58:08 +00:00
|
|
|
|
.It Ev FTP_PASSIVE_MODE
|
2000-12-06 09:23:27 +00:00
|
|
|
|
If set to anything but
|
|
|
|
|
.Ql no ,
|
|
|
|
|
forces the FTP code to use passive mode.
|
2000-10-29 12:58:08 +00:00
|
|
|
|
.It Ev FTP_PASSWORD
|
|
|
|
|
Default FTP password if the remote server requests one and none was
|
|
|
|
|
provided in the URL.
|
2000-07-11 18:13:08 +00:00
|
|
|
|
.It Ev FTP_PROXY
|
2000-10-12 22:11:26 +00:00
|
|
|
|
URL of the proxy to use for FTP requests.
|
|
|
|
|
The document part is ignored.
|
|
|
|
|
FTP and HTTP proxies are supported; if no scheme is specified, FTP is
|
|
|
|
|
assumed.
|
|
|
|
|
If the proxy is an FTP proxy,
|
2000-07-21 10:57:15 +00:00
|
|
|
|
.Nm libfetch
|
|
|
|
|
will send
|
|
|
|
|
.Ql user@host
|
|
|
|
|
as user name to the proxy, where
|
|
|
|
|
.Ql user
|
|
|
|
|
is the real user name, and
|
|
|
|
|
.Ql host
|
|
|
|
|
is the name of the FTP server.
|
2000-10-12 16:55:52 +00:00
|
|
|
|
.Pp
|
2000-08-31 15:13:22 +00:00
|
|
|
|
If this variable is set to an empty string, no proxy will be used for
|
|
|
|
|
FTP requests, even if the
|
|
|
|
|
.Ev HTTP_PROXY
|
|
|
|
|
variable is set.
|
2000-07-12 10:41:29 +00:00
|
|
|
|
.It Ev HTTP_AUTH
|
2000-10-12 16:55:52 +00:00
|
|
|
|
Specifies HTTP authorization parameters as a colon-separated list of
|
|
|
|
|
items.
|
2000-07-12 10:41:29 +00:00
|
|
|
|
The first and second item are the authorization scheme and realm
|
|
|
|
|
respectively; further items are scheme-dependent.
|
|
|
|
|
Currently, only basic authorization is supported.
|
2000-10-12 16:55:52 +00:00
|
|
|
|
.Pp
|
2000-07-12 10:41:29 +00:00
|
|
|
|
Basic authorization requires two parameters: the user name and
|
|
|
|
|
password, in that order.
|
2000-10-12 16:55:52 +00:00
|
|
|
|
.Pp
|
|
|
|
|
This variable is only used if the server requires authorization and
|
|
|
|
|
no user name or password was specified in the URL.
|
2000-07-11 18:13:08 +00:00
|
|
|
|
.It Ev HTTP_PROXY
|
2000-10-12 22:11:26 +00:00
|
|
|
|
URL of the proxy to use for HTTP requests.
|
|
|
|
|
The document part is ignored.
|
|
|
|
|
Only HTTP proxies are supported for HTTP requests.
|
2000-07-11 18:13:08 +00:00
|
|
|
|
If no port number is specified, the default is 3128.
|
2000-10-12 16:55:52 +00:00
|
|
|
|
.Pp
|
2000-10-12 22:11:26 +00:00
|
|
|
|
Note that this proxy will also be used for FTP documents, unless the
|
2000-07-21 10:57:15 +00:00
|
|
|
|
.Ev FTP_PROXY
|
|
|
|
|
variable is set.
|
2000-07-11 18:13:08 +00:00
|
|
|
|
.It Ev HTTP_PROXY_AUTH
|
2000-07-12 10:41:29 +00:00
|
|
|
|
Specifies authorization parameters for the HTTP proxy in the same
|
2000-07-21 10:57:15 +00:00
|
|
|
|
format as the
|
|
|
|
|
.Ev HTTP_AUTH
|
|
|
|
|
variable.
|
2000-10-12 16:55:52 +00:00
|
|
|
|
.Pp
|
2000-10-12 22:11:26 +00:00
|
|
|
|
This variable is used if and only if connected to an HTTP proxy, and
|
|
|
|
|
is ignored if a user and/or a password were specified in the proxy
|
|
|
|
|
URL.
|
2000-07-11 18:13:08 +00:00
|
|
|
|
.El
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Sh SEE ALSO
|
|
|
|
|
.Xr fetch 1 ,
|
2000-01-07 10:59:12 +00:00
|
|
|
|
.Xr ftpio 3 ,
|
2001-01-08 13:46:40 +00:00
|
|
|
|
.Xr ip 4
|
|
|
|
|
.Rs
|
|
|
|
|
.%A J. Postel
|
|
|
|
|
.%A J. K. Reynolds
|
|
|
|
|
.%D October 1985
|
|
|
|
|
.%B File Transfer Protocol
|
|
|
|
|
.%O RFC959
|
|
|
|
|
.Re
|
|
|
|
|
.Rs
|
|
|
|
|
.%A P. Deutsch
|
|
|
|
|
.%A A. Emtage
|
|
|
|
|
.%A A. Marine.
|
|
|
|
|
.%D May 1994
|
|
|
|
|
.%T How to Use Anonymous FTP
|
|
|
|
|
.%O RFC1635
|
2001-01-16 11:52:00 +00:00
|
|
|
|
.Re
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Rs
|
2000-05-10 09:49:04 +00:00
|
|
|
|
.%A T. Berners-Lee
|
|
|
|
|
.%A L. Masinter
|
|
|
|
|
.%A M. McCahill
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.%D December 1994
|
|
|
|
|
.%T Uniform Resource Locators (URL)
|
|
|
|
|
.%O RFC1738
|
|
|
|
|
.Re
|
|
|
|
|
.Rs
|
2000-05-10 09:49:04 +00:00
|
|
|
|
.%A R. Fielding
|
|
|
|
|
.%A J. Gettys
|
|
|
|
|
.%A J. Mogul
|
|
|
|
|
.%A H. Frystyk
|
|
|
|
|
.%A T. Berners-Lee
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.%D Januray 1997
|
|
|
|
|
.%B Hypertext Transfer Protocol -- HTTP/1.1
|
|
|
|
|
.%O RFC2068
|
|
|
|
|
.Re
|
|
|
|
|
.Sh HISTORY
|
|
|
|
|
The
|
|
|
|
|
.Nm fetch
|
|
|
|
|
library first appeared in
|
|
|
|
|
.Fx 3.0 .
|
|
|
|
|
.Sh AUTHORS
|
2000-11-22 09:23:54 +00:00
|
|
|
|
.An -nosplit
|
1998-07-09 16:52:44 +00:00
|
|
|
|
The
|
|
|
|
|
.Nm fetch
|
|
|
|
|
library was mostly written by
|
2000-11-14 13:19:26 +00:00
|
|
|
|
.An Dag-Erling Co\(:idan Sm\(/orgrav Aq des@FreeBSD.org
|
1998-07-09 16:52:44 +00:00
|
|
|
|
with numerous suggestions from
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
.An Jordan K. Hubbard Aq jkh@FreeBSD.org ,
|
|
|
|
|
.An Eugene Skepner Aq eu@qub.com
|
2000-11-14 11:20:58 +00:00
|
|
|
|
and other
|
|
|
|
|
.Fx
|
|
|
|
|
developers.
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
It replaces the older
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Nm ftpio
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
library written by
|
|
|
|
|
.An Poul-Henning Kamp Aq pkh@FreeBSD.org
|
|
|
|
|
and
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.An Jordan K. Hubbard Aq jkh@FreeBSD.org .
|
|
|
|
|
.Pp
|
|
|
|
|
This manual page was written by
|
2000-11-22 09:23:54 +00:00
|
|
|
|
.An Dag-Erling Co\(:idan Sm\(/orgrav Aq des@FreeBSD.org .
|
1998-07-09 16:52:44 +00:00
|
|
|
|
.Sh BUGS
|
2000-03-02 09:14:21 +00:00
|
|
|
|
Some parts of the library are not yet implemented.
|
|
|
|
|
The most notable
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
examples of this are
|
|
|
|
|
.Fn fetchPutHTTP ,
|
1998-12-21 19:41:50 +00:00
|
|
|
|
.Fn fetchListHTTP ,
|
2000-04-22 16:08:41 +00:00
|
|
|
|
.Fn fetchListFTP
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
and FTP proxy support.
|
|
|
|
|
.Pp
|
1998-09-26 20:42:44 +00:00
|
|
|
|
There's no way to select a proxy at run-time other than setting the
|
|
|
|
|
.Ev HTTP_PROXY
|
|
|
|
|
or
|
|
|
|
|
.Ev FTP_PROXY
|
2000-03-02 09:14:21 +00:00
|
|
|
|
environment variables as appropriate.
|
2000-07-12 10:41:29 +00:00
|
|
|
|
.Pp
|
1998-11-05 19:48:17 +00:00
|
|
|
|
.Nm libfetch
|
2000-07-12 10:41:29 +00:00
|
|
|
|
does not understand or obey 305 (Use Proxy) replies.
|
|
|
|
|
.Pp
|
1998-11-05 19:48:17 +00:00
|
|
|
|
Error numbers are unique only within a certain context; the error
|
|
|
|
|
codes used for FTP and HTTP overlap, as do those used for resolver and
|
2000-03-02 09:14:21 +00:00
|
|
|
|
system errors.
|
|
|
|
|
For instance, error code 202 means "Command not
|
1998-11-05 19:48:17 +00:00
|
|
|
|
implemented, superfluous at this site" in an FTP context and
|
|
|
|
|
"Accepted" in an HTTP context.
|
|
|
|
|
.Pp
|
2000-01-07 10:59:12 +00:00
|
|
|
|
.Fn fetchStatFTP
|
|
|
|
|
does not check that the result of an MDTM command is a valid date.
|
|
|
|
|
.Pp
|
2000-07-17 21:25:00 +00:00
|
|
|
|
The man page is incomplete, poorly written and produces badly
|
|
|
|
|
formatted text.
|
1998-09-26 20:42:44 +00:00
|
|
|
|
.Pp
|
2000-05-25 16:24:31 +00:00
|
|
|
|
The error reporting mechanism is unsatisfactory.
|
|
|
|
|
.Pp
|
|
|
|
|
Some parts of the code are not fully reentrant.
|