diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 1998-11-05 19:48:17 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 1998-11-05 19:48:17 +0000 |
commit | 842a95cc236e53afbf5e516267246c3408e0779e (patch) | |
tree | 8b89d29ae64536e49795ef9345d379e01ff05a95 /lib/libfetch/http.c | |
parent | 8984b8ccf6cfdc00d97df98870e1eeabbee0b8f2 (diff) | |
download | src-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/http.c')
-rw-r--r-- | lib/libfetch/http.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index 9ce86a9c8f0f..aea3d1d97dcc 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: http.c,v 1.4 1998/07/12 22:34:40 des Exp $ + * $Id: http.c,v 1.5 1998/08/17 09:30:19 des Exp $ */ /* @@ -77,6 +77,7 @@ #include <unistd.h> #include "fetch.h" +#include "common.h" #include "httperr.c" #ifndef NDEBUG @@ -103,20 +104,6 @@ struct cookie }; /* - * Look up error code - */ -static const char * -_http_errstring(int e) -{ - struct httperr *p = _http_errlist; - - while ((p->num != -1) && (p->num != e)) - p++; - - return p->string; -} - -/* * Send a formatted line; optionally echo to terminal */ static int |