summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/common.h
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-06-05 12:19:08 +0000
committerdes <des@FreeBSD.org>2002-06-05 12:19:08 +0000
commit0961c455f8e5016fb94b035bc9a95dc3ebf3d391 (patch)
tree9d2f71cb2f7d26ae6d8b7352243fb47c47f38c15 /lib/libfetch/common.h
parent02a39226769d736e4560560ca6ad1f323c528744 (diff)
downloadFreeBSD-src-0961c455f8e5016fb94b035bc9a95dc3ebf3d391.zip
FreeBSD-src-0961c455f8e5016fb94b035bc9a95dc3ebf3d391.tar.gz
Wrap everything in struct connection, and enforce timeouts everywhere
(except for DNS operations). Always use funopen() for HTTP, to support both timeouts and SSL.
Diffstat (limited to 'lib/libfetch/common.h')
-rw-r--r--lib/libfetch/common.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libfetch/common.h b/lib/libfetch/common.h
index 45c90bc..8b2a026 100644
--- a/lib/libfetch/common.h
+++ b/lib/libfetch/common.h
@@ -45,15 +45,13 @@
/* Connection */
typedef struct fetchconn conn_t;
struct fetchconn {
- char *host; /* host name */
- int port; /* port */
- int af; /* address family */
int sd; /* socket descriptor */
char *buf; /* buffer */
size_t bufsize; /* buffer size */
size_t buflen; /* length of buffer contents */
int err; /* last protocol reply code */
- SSL *ssl_ctx; /* SSL context if needed */
+ SSL *ssl; /* SSL handle */
+ SSL_CTX *ssl_ctx; /* SSL context */
X509 *ssl_cert; /* server certificate */
SSL_METHOD *ssl_meth; /* SSL method */
};
@@ -71,7 +69,10 @@ void _fetch_info(const char *, ...);
int _fetch_default_port(const char *);
int _fetch_default_proxy_port(const char *);
conn_t *_fetch_connect(const char *, int, int, int);
+conn_t *_fetch_reopen(int sd);
+ssize_t _fetch_read(conn_t *, char *, size_t);
int _fetch_getln(conn_t *);
+ssize_t _fetch_write(conn_t *, const char *, size_t);
int _fetch_putln(conn_t *, const char *, size_t);
int _fetch_close(conn_t *);
int _fetch_add_entry(struct url_ent **, int *, int *,
OpenPOWER on IntegriCloud