aboutsummaryrefslogtreecommitdiff
path: root/lib/libfetch/fetch.3
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>1998-11-05 19:48:17 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>1998-11-05 19:48:17 +0000
commit842a95cc236e53afbf5e516267246c3408e0779e (patch)
tree8b89d29ae64536e49795ef9345d379e01ff05a95 /lib/libfetch/fetch.3
parent8984b8ccf6cfdc00d97df98870e1eeabbee0b8f2 (diff)
downloadsrc-842a95cc236e53afbf5e516267246c3408e0779e.tar.gz
src-842a95cc236e53afbf5e516267246c3408e0779e.zip
First of a series of cleanups to libfetch. Changed files, in
alphabetical order: Makefile: Add common.c to SRCS. Make debugging easier by making 'CFLAGS += -DNDEBUG' conditional on DEBUG Don't declare struct {ftp,http}err in {ftp,http}err.c; use struct fetcherr instead. README: Remove the todo list, which is out of date anyway. common.c: (new file) Gather utility functions in this file. Merge the error reporting functions intp _fetch_errstring(), _fetch_seterr() and _fetch_syserr(). Set fetchLastErrCode and fetchLastErrText appropriately when fetchConnect fails. common.h: (new file) Gather internal prototypes and structures in this files. fetch.3: Undocument fetchFreeURL(). Document a few more known bugs. Document fetchLastErrCode and fetchLastErrText. fetch.c: Add descriptive comments to all functions that lacked them. Move fetchConnect() to common.c. Obviate the need for fetchFreeURL(), and remove it. fetch.h: Modify struct url_t so the document part is at the end. ftp.c: Remove code that is duplicated elsewhere. http.c: Remove code that is duplicated elsewhere. Prompted by: jkh
Notes
Notes: svn path=/head/; revision=40939
Diffstat (limited to 'lib/libfetch/fetch.3')
-rw-r--r--lib/libfetch/fetch.337
1 files changed, 26 insertions, 11 deletions
diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3
index c23d0677b827..2b4c63af6a80 100644
--- a/lib/libfetch/fetch.3
+++ b/lib/libfetch/fetch.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: fetch.3,v 1.1.1.1 1998/07/09 16:52:43 des Exp $
+.\" $Id: fetch.3,v 1.2 1998/09/26 20:42:44 des Exp $
.\"
.Dd July 1, 1998
.Dt FETCH 3
@@ -31,7 +31,6 @@
.Nm fetchGetURL ,
.Nm fetchPutURL ,
.Nm fetchParseURL ,
-.Nm fetchFreeURL ,
.Nm fetchGet ,
.Nm fetchPut ,
.Nm fetchGetFile ,
@@ -49,8 +48,6 @@
.Fn fetchPutURL "char *URL" "char *flags"
.Ft url_t *
.Fn fetchParseURL "char *URL" "char *flags"
-.Ft void
-.Fn fetchFreeURL "url_t *u"
.Ft FILE *
.Fn fetchGet "url_t *URL" "char *flags"
.Ft FILE *
@@ -67,6 +64,8 @@
.Fn fetchGetFTP "url_t *u" "char *flags"
.Ft FILE *
.Fn fetchPutFTP "url_t *u" "char *flags"
+.Vt extern int fetchLastErrCode;
+.Vt extern const char *fetchLastErrText;
.Sh DESCRIPTION
These functions implement a high-level library for retrieving and
uploading files using Uniform Resource Locators (URLs).
@@ -100,7 +99,7 @@ and <document> components.
The pointer returned by
.Fn fetchParseURL
should be freed using
-.Fn fetchFreeURL .
+.Fn free .
.Pp
.Fn fetchGet
and
@@ -182,12 +181,13 @@ unable to allocate memory, or the URL is syntactically incorrect,
.Fn fetchParseURL
returns a NULL pointer.
.Pp
-.Fn fetchFreeURL
-does not return any value.
-.Pp
All other functions return a stream pointer which may be used to
-access the requested document. Upon failure of any kind, they return a
-NULL pointer.
+access the requested document, or NULL if an error occurred. In the
+latter case, the variables
+.Va fetchLastErrCode
+and
+.Va fetchLastErrText
+are set to appropriately descriptive values.
.Sh ENVIRONMENT
The FTP and HTTP related functions use the
.Ev HTTP_PROXY
@@ -259,6 +259,21 @@ code; as far as I can determine,
.Nm libfetch
handles HTTP/1.1 basic authentication correctly as outlined in
RFC2068, but I haven't been able to find an HTTP server that honors
-the Authentication: header field.
+the Authentication: header field. Also,
+.Nm libfetch
+does not attempt to interpret and respond to authentication requests
+from the HTTP server.
+.Pp
+No attempt is made to encode spaces etc. within URLs. Spaces in the
+document part of an URLshould be replaced with "%20" in HTTP URLs and
+"\\ " in FTP URLs.
+.Pp
+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
+system errors. For instance, error code 202 means "Command not
+implemented, superfluous at this site" in an FTP context and
+"Accepted" in an HTTP context.
+.Pp
+The man page is poorly written and produces badly formatted text.
.Pp
Tons of other stuff.