xref: /netbsd-src/external/bsd/fetch/dist/libfetch/fetch.3 (revision 3816d47b2c42fcd6e549e3407f842a5b1a1d23ad)
1.\"-
2.\" Copyright (c) 1998-2004 Dag-Erling Co�dan Sm�rgrav
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD: fetch.3,v 1.64 2007/12/18 11:03:26 des Exp $
27.\" $NetBSD: fetch.3,v 1.1.1.7 2009/10/15 12:59:58 joerg Exp $
28.\"
29.Dd February 4, 2009
30.Dt FETCH 3
31.Os
32.Sh NAME
33.Nm fetchMakeURL ,
34.Nm fetchParseURL ,
35.Nm fetchCopyURL ,
36.Nm fetchFreeURL ,
37.Nm fetchXGetURL ,
38.Nm fetchGetURL ,
39.Nm fetchPutURL ,
40.Nm fetchStatURL ,
41.Nm fetchListURL ,
42.Nm fetchXGet ,
43.Nm fetchGet ,
44.Nm fetchPut ,
45.Nm fetchStat ,
46.Nm fetchList ,
47.Nm fetchXGetFile ,
48.Nm fetchGetFile ,
49.Nm fetchPutFile ,
50.Nm fetchStatFile ,
51.Nm fetchListFile ,
52.Nm fetchXGetHTTP ,
53.Nm fetchGetHTTP ,
54.Nm fetchPutHTTP ,
55.Nm fetchStatHTTP ,
56.Nm fetchListHTTP ,
57.Nm fetchXGetFTP ,
58.Nm fetchGetFTP ,
59.Nm fetchPutFTP ,
60.Nm fetchStatFTP ,
61.Nm fetchListFTP
62.Nm fetchInitURLList ,
63.Nm fetchFreeURLList ,
64.Nm fetchUnquotePath ,
65.Nm fetchUnquoteFilename ,
66.Nm fetchStringifyURL ,
67.Nm fetch
68.Nd file transfer functions
69.Sh LIBRARY
70.Lb libfetch
71.Sh SYNOPSIS
72.In stdio.h
73.In fetch.h
74.Ft struct url *
75.Fn fetchMakeURL "const char *scheme" "const char *host" "int port" "const char *doc" "const char *user" "const char *pwd"
76.Ft struct url *
77.Fn fetchParseURL "const char *URL"
78.Ft struct url *
79.Fn fetchCopyURL "const struct url *u"
80.Ft void
81.Fn fetchFreeURL "struct url *u"
82.Ft fetchIO *
83.Fn fetchXGetURL "const char *URL" "struct url_stat *us" "const char *flags"
84.Ft fetchIO *
85.Fn fetchGetURL "const char *URL" "const char *flags"
86.Ft fetchIO *
87.Fn fetchPutURL "const char *URL" "const char *flags"
88.Ft int
89.Fn fetchStatURL "const char *URL" "struct url_stat *us" "const char *flags"
90.Ft int
91.Fn fetchListURL "struct url_list *list" "const char *URL" "const char *flags"
92.Ft fetchIO *
93.Fn fetchXGet "struct url *u" "struct url_stat *us" "const char *flags"
94.Ft fetchIO *
95.Fn fetchGet "struct url *u" "const char *flags"
96.Ft fetchIO *
97.Fn fetchPut "struct url *u" "const char *flags"
98.Ft int
99.Fn fetchStat "struct url *u" "struct url_stat *us" "const char *flags"
100.Ft int
101.Fn fetchList "struct url_list *list" "struct url *u" "const char *flags"
102.Ft fetchIO *
103.Fn fetchXGetFile "struct url *u" "struct url_stat *us" "const char *flags"
104.Ft fetchIO *
105.Fn fetchGetFile "struct url *u" "const char *flags"
106.Ft fetchIO *
107.Fn fetchPutFile "struct url *u" "const char *flags"
108.Ft int
109.Fn fetchStatFile "struct url *u" "struct url_stat *us" "const char *flags"
110.Ft int
111.Fn fetchListFile "struct url_list *list" "struct url *u" "const char *flags"
112.Ft fetchIO *
113.Fn fetchXGetHTTP "struct url *u" "struct url_stat *us" "const char *flags"
114.Ft fetchIO *
115.Fn fetchGetHTTP "struct url *u" "const char *flags"
116.Ft fetchIO *
117.Fn fetchPutHTTP "struct url *u" "const char *flags"
118.Ft int
119.Fn fetchStatHTTP "struct url *u" "struct url_stat *us" "const char *flags"
120.Ft int
121.Fn fetchListHTTP "struct url_list *list" "struct url *u" "const char *flags"
122.Ft fetchIO *
123.Fn fetchXGetFTP "struct url *u" "struct url_stat *us" "const char *flags"
124.Ft fetchIO *
125.Fn fetchGetFTP "struct url *u" "const char *flags"
126.Ft fetchIO *
127.Fn fetchPutFTP "struct url *u" "const char *flags"
128.Ft int
129.Fn fetchStatFTP "struct url *u" "struct url_stat *us" "const char *flags"
130.Ft int
131.Fn fetchListFTP "struct url_list *list" "struct url *u" "const char *flags"
132.Ft void
133.Fn fetchInitURLList "struct url_list *ul"
134.Ft int
135.Fn fetchAppendURLList "struct url_list *dst" "const struct url_list *src"
136.Ft void
137.Fn fetchFreeURLList "struct url_list *ul"
138.Ft char *
139.Fn fetchUnquotePath "struct url *u"
140.Ft char *
141.Fn fetchUnquoteFilename "struct url *u"
142.Ft char *
143.Fn fetchStringifyURL "const struct url *u"
144.Sh DESCRIPTION
145These functions implement a high-level library for retrieving and
146uploading files using Uniform Resource Locators (URLs).
147.Pp
148.Fn fetchParseURL
149takes a URL in the form of a null-terminated string and splits it into
150its components function according to the Common Internet Scheme Syntax
151detailed in RFC 1738.
152A regular expression which produces this syntax is:
153.Bd -literal -offset indent
154\*[Lt]scheme\*[Gt]:(//(\*[Lt]user\*[Gt](:\*[Lt]pwd\*[Gt])?@)?\*[Lt]host\*[Gt](:\*[Lt]port\*[Gt])?)?/(\*[Lt]document\*[Gt])?
155.Ed
156.Pp
157If the URL does not seem to begin with a scheme name, it is assumed to be a local path.
158Only absolute path names are accepted.
159.Pp
160Note that some components of the URL are not necessarily relevant to
161all URL schemes.
162For instance, the file scheme only needs the
163.Aq scheme
164and
165.Aq document
166components.
167.Fn fetchParseURL
168quotes any unsafe character in the URL automatically.
169This is not done by
170.Fn fetchMakeURL .
171.Fn fetchCopyURL
172copies an existing
173.Vt url
174structure.
175.Pp
176.Fn fetchMakeURL ,
177.Fn fetchParseURL ,
178and
179.Fn fetchCopyURL
180return a pointer to a
181.Vt url
182structure, which is defined as follows in
183.In fetch.h :
184.Bd -literal
185#define URL_SCHEMELEN 16
186#define URL_USERLEN 256
187#define URL_PWDLEN 256
188#define URL_HOSTLEN 255
189
190struct url {
191    char	 scheme[URL_SCHEMELEN + 1];
192    char	 user[URL_USERLEN + 1];
193    char	 pwd[URL_PWDLEN + 1];
194    char	 host[URL_HOSTLEN + 1];
195    int		 port;
196    char	*doc;
197    off_t	 offset;
198    size_t	 length;
199    time_t	 last_modified;
200};
201.Ed
202.Pp
203The pointer returned by
204.Fn fetchMakeURL ,
205.Fn fetchCopyURL ,
206and
207.Fn fetchParseURL
208should be freed using
209.Fn fetchFreeURL .
210The size of
211.Vt struct URL
212is not part of the ABI.
213.Pp
214.Fn fetchXGetURL ,
215.Fn fetchGetURL ,
216and
217.Fn fetchPutURL
218constitute the recommended interface to the
219.Nm fetch
220library.
221They examine the URL passed to them to determine the transfer
222method, and call the appropriate lower-level functions to perform the
223actual transfer.
224.Fn fetchXGetURL
225also returns the remote document's metadata in the
226.Vt url_stat
227structure pointed to by the
228.Fa us
229argument.
230.Pp
231The
232.Fa flags
233argument is a string of characters which specify transfer options.
234The
235meaning of the individual flags is scheme-dependent, and is detailed
236in the appropriate section below.
237.Pp
238.Fn fetchStatURL
239attempts to obtain the requested document's metadata and fill in the
240structure pointed to by its second argument.
241The
242.Vt url_stat
243structure is defined as follows in
244.In fetch.h :
245.Bd -literal
246struct url_stat {
247    off_t	 size;
248    time_t	 atime;
249    time_t	 mtime;
250};
251.Ed
252.Pp
253If the size could not be obtained from the server, the
254.Fa size
255field is set to \-1.
256If the modification time could not be obtained from the server, the
257.Fa mtime
258field is set to the epoch.
259If the access time could not be obtained from the server, the
260.Fa atime
261field is set to the modification time.
262.Pp
263.Fn fetchListURL
264attempts to list the contents of the directory pointed to by the URL provided.
265The pattern can be a simple glob-like expression as hint.
266Callers should not depend on the server to filter names.
267If successful, it appends the list of entries to the
268.Vt url_list
269structure.
270The
271.Vt url_list
272structure is defined as follows in
273.In fetch.h :
274.Bd -literal
275struct url_list {
276    size_t	length;
277    size_t	alloc_size;
278    struct url	*urls;
279};
280.Ed
281.Pp
282The list should be initialized by calling
283.Fn fetchInitURLList
284and the entries be freed by calling
285.Fn fetchFreeURLList .
286The function
287.Fn fetchAppendURLList
288can be used to append one URL lists to another.
289If the
290.Ql c
291(cache result) flag is specified, the library is allowed to internally
292cache the result.
293.Pp
294.Fn fetchStringifyURL
295returns the URL as string.
296.Fn fetchUnquotePath
297returns the path name part of the URL with any quoting undone.
298Query arguments and fragment identifiers are not included.
299.Fn fetchUnquoteFilename
300returns the last component of the path name as returned by
301.Fn fetchUnquotePath .
302.Fn fetchStringifyURL ,
303.Fn fetchUnquotePath ,
304and
305.Fn fetchUnquoteFilename
306return a string that should be deallocated with
307.Fn free
308after use.
309.Pp
310.Fn fetchXGet ,
311.Fn fetchGet ,
312.Fn fetchPut ,
313and
314.Fn fetchStat
315are similar to
316.Fn fetchXGetURL ,
317.Fn fetchGetURL ,
318.Fn fetchPutURL ,
319and
320.Fn fetchStatURL ,
321except that they expect a pre-parsed URL in the form of a pointer to
322a
323.Vt struct url
324rather than a string.
325.Pp
326All of the
327.Fn fetchXGetXXX ,
328.Fn fetchGetXXX ,
329and
330.Fn fetchPutXXX
331functions return a pointer to a stream which can be used to read or
332write data from or to the requested document, respectively.
333Note that
334although the implementation details of the individual access methods
335vary, it can generally be assumed that a stream returned by one of the
336.Fn fetchXGetXXX
337or
338.Fn fetchGetXXX
339functions is read-only, and that a stream returned by one of the
340.Fn fetchPutXXX
341functions is write-only.
342.Sh PROTOCOL INDEPENDENT FLAGS
343If the
344.Ql i
345(if-modified-since) flag is specified, the library will try to fetch
346the content only if it is newer than
347.Va last_modified .
348For HTTP an
349.Li If-Modified-Since
350HTTP header is sent.
351For FTP a
352.Li MTDM
353command is sent first and compared locally.
354For FILE the source file is compared.
355.Sh FILE SCHEME
356.Fn fetchXGetFile ,
357.Fn fetchGetFile ,
358and
359.Fn fetchPutFile
360provide access to documents which are files in a locally mounted file
361system.
362Only the
363.Aq document
364component of the URL is used.
365.Pp
366.Fn fetchXGetFile
367and
368.Fn fetchGetFile
369do not accept any flags.
370.Pp
371.Fn fetchPutFile
372accepts the
373.Ql a
374(append to file) flag.
375If that flag is specified, the data written to
376the stream returned by
377.Fn fetchPutFile
378will be appended to the previous contents of the file, instead of
379replacing them.
380.Sh FTP SCHEME
381.Fn fetchXGetFTP ,
382.Fn fetchGetFTP ,
383and
384.Fn fetchPutFTP
385implement the FTP protocol as described in RFC 959.
386.Pp
387By default
388.Nm libfetch
389will attempt to use passive mode first and only fallback to active mode
390if the server reports a syntax error.
391If the
392.Ql a
393(active) flag is specified, a passive connection is not tried and active mode
394is used directly.
395.Pp
396If the
397.Ql l
398(low) flag is specified, data sockets will be allocated in the low (or
399default) port range instead of the high port range (see
400.Xr ip 4 ) .
401.Pp
402If the
403.Ql d
404(direct) flag is specified,
405.Fn fetchXGetFTP ,
406.Fn fetchGetFTP ,
407and
408.Fn fetchPutFTP
409will use a direct connection even if a proxy server is defined.
410.Pp
411If no user name or password is given, the
412.Nm fetch
413library will attempt an anonymous login, with user name "anonymous"
414and password "anonymous@\*[Lt]hostname\*[Gt]".
415.Sh HTTP SCHEME
416The
417.Fn fetchXGetHTTP ,
418.Fn fetchGetHTTP ,
419and
420.Fn fetchPutHTTP
421functions implement the HTTP/1.1 protocol.
422With a little luck, there is
423even a chance that they comply with RFC 2616 and RFC 2617.
424.Pp
425If the
426.Ql d
427(direct) flag is specified,
428.Fn fetchXGetHTTP ,
429.Fn fetchGetHTTP ,
430and
431.Fn fetchPutHTTP
432will use a direct connection even if a proxy server is defined.
433.Pp
434Since there seems to be no good way of implementing the HTTP PUT
435method in a manner consistent with the rest of the
436.Nm fetch
437library,
438.Fn fetchPutHTTP
439is currently unimplemented.
440.Sh AUTHENTICATION
441Apart from setting the appropriate environment variables and
442specifying the user name and password in the URL or the
443.Vt struct url ,
444the calling program has the option of defining an authentication
445function with the following prototype:
446.Pp
447.Ft int
448.Fn myAuthMethod "struct url *u"
449.Pp
450The callback function should fill in the
451.Fa user
452and
453.Fa pwd
454fields in the provided
455.Vt struct url
456and return 0 on success, or any other value to indicate failure.
457.Pp
458To register the authentication callback, simply set
459.Va fetchAuthMethod
460to point at it.
461The callback will be used whenever a site requires authentication and
462the appropriate environment variables are not set.
463.Pp
464This interface is experimental and may be subject to change.
465.Sh RETURN VALUES
466.Fn fetchParseURL
467returns a pointer to a
468.Vt struct url
469containing the individual components of the URL.
470If it is
471unable to allocate memory, or the URL is syntactically incorrect,
472.Fn fetchParseURL
473returns a
474.Dv NULL
475pointer.
476.Pp
477The
478.Fn fetchStat
479functions return 0 on success and \-1 on failure.
480.Pp
481All other functions return a stream pointer which may be used to
482access the requested document, or
483.Dv NULL
484if an error occurred.
485.Pp
486The following error codes are defined in
487.In fetch.h :
488.Bl -tag -width 18n
489.It Bq Er FETCH_ABORT
490Operation aborted
491.It Bq Er FETCH_AUTH
492Authentication failed
493.It Bq Er FETCH_DOWN
494Service unavailable
495.It Bq Er FETCH_EXISTS
496File exists
497.It Bq Er FETCH_FULL
498File system full
499.It Bq Er FETCH_INFO
500Informational response
501.It Bq Er FETCH_MEMORY
502Insufficient memory
503.It Bq Er FETCH_MOVED
504File has moved
505.It Bq Er FETCH_NETWORK
506Network error
507.It Bq Er FETCH_OK
508No error
509.It Bq Er FETCH_PROTO
510Protocol error
511.It Bq Er FETCH_RESOLV
512Resolver error
513.It Bq Er FETCH_SERVER
514Server error
515.It Bq Er FETCH_TEMP
516Temporary error
517.It Bq Er FETCH_TIMEOUT
518Operation timed out
519.It Bq Er FETCH_UNAVAIL
520File is not available
521.It Bq Er FETCH_UNKNOWN
522Unknown error
523.It Bq Er FETCH_URL
524Invalid URL
525.El
526.Pp
527The accompanying error message includes a protocol-specific error code
528and message, e.g.\& "File is not available (404 Not Found)"
529.Sh ENVIRONMENT
530.Bl -tag -width ".Ev FETCH_BIND_ADDRESS"
531.It Ev FETCH_BIND_ADDRESS
532Specifies a host name or IP address to which sockets used for outgoing
533connections will be bound.
534.It Ev FTP_LOGIN
535Default FTP login if none was provided in the URL.
536.It Ev FTP_PASSIVE_MODE
537If set to anything but
538.Ql no ,
539forces the FTP code to use passive mode.
540.It Ev FTP_PASSWORD
541Default FTP password if the remote server requests one and none was
542provided in the URL.
543.It Ev FTP_PROXY
544URL of the proxy to use for FTP requests.
545The document part is ignored.
546FTP and HTTP proxies are supported; if no scheme is specified, FTP is
547assumed.
548If the proxy is an FTP proxy,
549.Nm libfetch
550will send
551.Ql user@host
552as user name to the proxy, where
553.Ql user
554is the real user name, and
555.Ql host
556is the name of the FTP server.
557.Pp
558If this variable is set to an empty string, no proxy will be used for
559FTP requests, even if the
560.Ev HTTP_PROXY
561variable is set.
562.It Ev ftp_proxy
563Same as
564.Ev FTP_PROXY ,
565for compatibility.
566.It Ev HTTP_AUTH
567Specifies HTTP authorization parameters as a colon-separated list of
568items.
569The first and second item are the authorization scheme and realm
570respectively; further items are scheme-dependent.
571Currently, only basic authorization is supported.
572.Pp
573Basic authorization requires two parameters: the user name and
574password, in that order.
575.Pp
576This variable is only used if the server requires authorization and
577no user name or password was specified in the URL.
578.It Ev HTTP_PROXY
579URL of the proxy to use for HTTP requests.
580The document part is ignored.
581Only HTTP proxies are supported for HTTP requests.
582If no port number is specified, the default is 3128.
583.Pp
584Note that this proxy will also be used for FTP documents, unless the
585.Ev FTP_PROXY
586variable is set.
587.It Ev http_proxy
588Same as
589.Ev HTTP_PROXY ,
590for compatibility.
591.It Ev HTTP_PROXY_AUTH
592Specifies authorization parameters for the HTTP proxy in the same
593format as the
594.Ev HTTP_AUTH
595variable.
596.Pp
597This variable is used if and only if connected to an HTTP proxy, and
598is ignored if a user and/or a password were specified in the proxy
599URL.
600.It Ev HTTP_REFERER
601Specifies the referrer URL to use for HTTP requests.
602If set to
603.Dq auto ,
604the document URL will be used as referrer URL.
605.It Ev HTTP_USER_AGENT
606Specifies the User-Agent string to use for HTTP requests.
607This can be useful when working with HTTP origin or proxy servers that
608differentiate between user agents.
609.It Ev NETRC
610Specifies a file to use instead of
611.Pa ~/.netrc
612to look up login names and passwords for FTP sites.
613See
614.Xr ftp 1
615for a description of the file format.
616This feature is experimental.
617.It Ev NO_PROXY
618Either a single asterisk, which disables the use of proxies
619altogether, or a comma- or whitespace-separated list of hosts for
620which proxies should not be used.
621.It Ev no_proxy
622Same as
623.Ev NO_PROXY ,
624for compatibility.
625.El
626.Sh EXAMPLES
627To access a proxy server on
628.Pa proxy.example.com
629port 8080, set the
630.Ev HTTP_PROXY
631environment variable in a manner similar to this:
632.Pp
633.Dl HTTP_PROXY=http://proxy.example.com:8080
634.Pp
635If the proxy server requires authentication, there are
636two options available for passing the authentication data.
637The first method is by using the proxy URL:
638.Pp
639.Dl HTTP_PROXY=http://\*[Lt]user\*[Gt]:\*[Lt]pwd\*[Gt]@proxy.example.com:8080
640.Pp
641The second method is by using the
642.Ev HTTP_PROXY_AUTH
643environment variable:
644.Bd -literal -offset indent
645HTTP_PROXY=http://proxy.example.com:8080
646HTTP_PROXY_AUTH=basic:*:\*[Lt]user\*[Gt]:\*[Lt]pwd\*[Gt]
647.Ed
648.Pp
649To disable the use of a proxy for an HTTP server running on the local
650host, define
651.Ev NO_PROXY
652as follows:
653.Bd -literal -offset indent
654NO_PROXY=localhost,127.0.0.1
655.Ed
656.Sh SEE ALSO
657.\" .Xr fetch 1 ,
658.\" .Xr ftpio 3 ,
659.Xr ftp 1 ,
660.Xr ip 4
661.Rs
662.%A J. Postel
663.%A J. K. Reynolds
664.%D October 1985
665.%B File Transfer Protocol
666.%O RFC 959
667.Re
668.Rs
669.%A P. Deutsch
670.%A A. Emtage
671.%A A. Marine
672.%D May 1994
673.%T How to Use Anonymous FTP
674.%O RFC 1635
675.Re
676.Rs
677.%A T. Berners-Lee
678.%A L. Masinter
679.%A M. McCahill
680.%D December 1994
681.%T Uniform Resource Locators (URL)
682.%O RFC 1738
683.Re
684.Rs
685.%A R. Fielding
686.%A J. Gettys
687.%A J. Mogul
688.%A H. Frystyk
689.%A L. Masinter
690.%A P. Leach
691.%A T. Berners-Lee
692.%D January 1999
693.%B Hypertext Transfer Protocol -- HTTP/1.1
694.%O RFC 2616
695.Re
696.Rs
697.%A J. Franks
698.%A P. Hallam-Baker
699.%A J. Hostetler
700.%A S. Lawrence
701.%A P. Leach
702.%A A. Luotonen
703.%A L. Stewart
704.%D June 1999
705.%B HTTP Authentication: Basic and Digest Access Authentication
706.%O RFC 2617
707.Re
708.Sh HISTORY
709The
710.Nm fetch
711library first appeared in
712.Fx 3.0 .
713.Sh AUTHORS
714.An -nosplit
715The
716.Nm fetch
717library was mostly written by
718.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org
719with numerous suggestions from
720.An Jordan K. Hubbard Aq jkh@FreeBSD.org ,
721.An Eugene Skepner Aq eu@qub.com
722and other
723.Fx
724developers.
725It replaces the older
726.Nm ftpio
727library written by
728.An Poul-Henning Kamp Aq phk@FreeBSD.org
729and
730.An Jordan K. Hubbard Aq jkh@FreeBSD.org .
731.Pp
732This manual page was written by
733.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
734.Sh BUGS
735Some parts of the library are not yet implemented.
736The most notable
737examples of this are
738.Fn fetchPutHTTP
739and FTP proxy support.
740.Pp
741There is no way to select a proxy at run-time other than setting the
742.Ev HTTP_PROXY
743or
744.Ev FTP_PROXY
745environment variables as appropriate.
746.Pp
747.Nm libfetch
748does not understand or obey 305 (Use Proxy) replies.
749.Pp
750Error numbers are unique only within a certain context; the error
751codes used for FTP and HTTP overlap, as do those used for resolver and
752system errors.
753For instance, error code 202 means "Command not
754implemented, superfluous at this site" in an FTP context and
755"Accepted" in an HTTP context.
756.Pp
757.Fn fetchStatFTP
758does not check that the result of an MDTM command is a valid date.
759.Pp
760The man page is incomplete, poorly written and produces badly
761formatted text.
762.Pp
763The error reporting mechanism is unsatisfactory.
764.Pp
765Some parts of the code are not fully reentrant.
766