summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/common.h
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2014-01-28 12:48:17 +0000
committerdes <des@FreeBSD.org>2014-01-28 12:48:17 +0000
commit2010baa9c1222ce144a45f1d7485b958e9be88fd (patch)
treea563a19143ca0971436134fef3e8f7eea5e74bd2 /lib/libfetch/common.h
parent86c4a7f196f3692d803d8c2b0595762ce2a9b608 (diff)
downloadFreeBSD-src-2010baa9c1222ce144a45f1d7485b958e9be88fd.zip
FreeBSD-src-2010baa9c1222ce144a45f1d7485b958e9be88fd.tar.gz
Solve http buffering issues and hangs once and for all (hopefully!) by
simply not trying to return exactly what the caller asked for - just return whatever we got and let the caller be the judge of whether it was enough. If an error occurs or the connection times out after we already received some data, return a short read, under the assumption that the next call will fail or time out before we read anything. As it turns out, none of the code that calls fetch_read() assumes an all-or-nothing result anyway, except for a couple of lines where we read the CR LF at the end of a hunk in HTTP hunked encoding, so the changes outside of fetch_read() and http_readfn() are minimal. While there, replace select(2) with poll(2). MFC after: 3 days
Diffstat (limited to 'lib/libfetch/common.h')
-rw-r--r--lib/libfetch/common.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/lib/libfetch/common.h b/lib/libfetch/common.h
index 1d543a6..ba45534 100644
--- a/lib/libfetch/common.h
+++ b/lib/libfetch/common.h
@@ -52,13 +52,6 @@ struct fetchconn {
size_t bufsize; /* buffer size */
size_t buflen; /* length of buffer contents */
int err; /* last protocol reply code */
- struct { /* data cached after an interrupted
- read */
- char *buf;
- size_t size;
- size_t pos;
- size_t len;
- } cache;
#ifdef WITH_SSL
SSL *ssl; /* SSL handle */
SSL_CTX *ssl_ctx; /* SSL context */
OpenPOWER on IntegriCloud