summaryrefslogtreecommitdiff
path: root/lib/rpmurl.h
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-11-09 20:57:38 +0000
committerjbj <devnull@localhost>1999-11-09 20:57:38 +0000
commitaeab1e959d1fb383a0ff21924bff0edd01404fab (patch)
tree76a5591a2719e16aae6c290812d44c65c807b5dd /lib/rpmurl.h
parent20cafc16fec4345edef90a5e8586de6434eed773 (diff)
downloadrpm-aeab1e959d1fb383a0ff21924bff0edd01404fab.tar.gz
rpm-aeab1e959d1fb383a0ff21924bff0edd01404fab.tar.bz2
rpm-aeab1e959d1fb383a0ff21924bff0edd01404fab.zip
fix: typo in error message (#6858).
tufdio.c: Create. rpmurl.h: Add ctrl, data, buf, and bufAlloced to urlinfo. UFDSANE assertion. rpmio.h: Add fdWritable(), fdReadable(), fdRdline(), exported (for now) to ftp.c checkResponse(). ftp.c: checkResponse() rewritten to use above. ftp.c: checkResponse() handles html in 501 response on closed http connection. ftp.c: ftpCommand() rewritten to simplify (using stpcpy). ftp.c: httpOpen() now reopens time-out persistent connection. ftp.c: Get rid of O_NONBLOCK reads, not necessary AFAICT. ftp.c: ftpFileDesc() uses u->data rather than passed in fd arg. Use a consistent refcounting scheme to achieve persistent malloc and open ctrl. query.c: get ready for Remglob(). rpmio.c: ftpCmd() functional (using tufdio). CVS patchset: 3420 CVS date: 1999/11/09 20:57:38
Diffstat (limited to 'lib/rpmurl.h')
-rw-r--r--lib/rpmurl.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/rpmurl.h b/lib/rpmurl.h
index 03d6cb9fb..ff09868cb 100644
--- a/lib/rpmurl.h
+++ b/lib/rpmurl.h
@@ -1,6 +1,8 @@
#ifndef H_RPMURL
#define H_RPMURL
+#include <assert.h>
+
#ifndef IPPORT_FTP
#define IPPORT_FTP 21
#endif
@@ -29,6 +31,9 @@ typedef enum {
URL_IS_HTTP = 4
} urltype;
+#define URLMAGIC 0xd00b1ed0
+#define URLSANE(u) assert(u && u->magic == URLMAGIC)
+
typedef /*@abstract@*/ /*@refcounted@*/ struct urlinfo {
/*@refs@*/ int nrefs;
const char * url; /* copy of original url */
@@ -42,13 +47,17 @@ typedef /*@abstract@*/ /*@refcounted@*/ struct urlinfo {
const char * proxyh; /* FTP/HTTP: proxy host */
int proxyp; /* FTP/HTTP: proxy port */
int port;
- FD_t ftpControl;
+ FD_t ctrl; /* control channel */
+ FD_t data; /* per-xfer data channel */
+ int bufAlloced; /* sizeof I/O buffer */
+ char *buf; /* I/O buffer */
int ftpFileDoneNeeded;
int openError; /* Type of open failure */
int httpVersion;
int httpHasRange;
int httpContentLength;
int httpPersist;
+ int magic;
} *urlinfo;
#ifdef __cplusplus
@@ -56,10 +65,12 @@ extern "C" {
#endif
int ftpCheckResponse(urlinfo u, /*@out@*/ char ** str);
+int ftpCommand(urlinfo u, ...);
+
int httpOpen(urlinfo u, const char * httpcmd);
int ftpOpen(urlinfo u);
int ftpFileDone(urlinfo u);
-int ftpFileDesc(urlinfo u, const char * cmd, FD_t fd);
+int ftpFileDesc(urlinfo u, const char * cmd);
urlinfo urlLink(urlinfo u, const char * msg);
urlinfo XurlLink(urlinfo u, const char * msg, const char * file, unsigned line);
@@ -69,8 +80,8 @@ urlinfo urlNew(const char * msg);
urlinfo XurlNew(const char * msg, const char * file, unsigned line);
#define urlNew(_msg) XurlNew(_msg, __FILE__, __LINE__)
-void urlFree( /*@killref@*/ urlinfo u, const char * msg);
-void XurlFree( /*@killref@*/ urlinfo u, const char * msg, const char * file, unsigned line);
+urlinfo urlFree( /*@killref@*/ urlinfo u, const char * msg);
+urlinfo XurlFree( /*@killref@*/ urlinfo u, const char * msg, const char * file, unsigned line);
#define urlFree(_u, _msg) XurlFree(_u, _msg, __FILE__, __LINE__)
void urlFreeCache(void);