diff options
author | des <des@FreeBSD.org> | 2002-06-05 21:35:35 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-06-05 21:35:35 +0000 |
commit | 0642a9650fe4b6103c0451e05fb070f112e607df (patch) | |
tree | 0509c1c0fc4b92c600c8202a518165929fa017e2 /lib/libfetch/common.c | |
parent | 6a22781391d2cbe7ac126b3a82e84ccf075507a3 (diff) | |
download | FreeBSD-src-0642a9650fe4b6103c0451e05fb070f112e607df.zip FreeBSD-src-0642a9650fe4b6103c0451e05fb070f112e607df.tar.gz |
Make SSL support conditional on NOCRYPT.
Diffstat (limited to 'lib/libfetch/common.c')
-rw-r--r-- | lib/libfetch/common.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 775b4c7..c234fab 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -270,6 +270,7 @@ int _fetch_ssl(conn_t *conn, int verbose) { +#ifdef WITH_SSL /* Init the SSL library and context */ if (!SSL_library_init()){ fprintf(stderr, "SSL library init failed\n"); @@ -310,6 +311,12 @@ _fetch_ssl(conn_t *conn, int verbose) } return (0); +#else + (void)conn; + (void)verbose; + fprintf(stderr, "SSL support disabled\n"); + return (-1); +#endif } /* @@ -350,9 +357,11 @@ _fetch_read(conn_t *conn, char *buf, size_t len) return (-1); } } +#ifdef WITH_SSL if (conn->ssl != NULL) rlen = SSL_read(conn->ssl, buf, len); else +#endif rlen = read(conn->sd, buf, len); if (rlen == 0) break; @@ -453,9 +462,11 @@ _fetch_write(conn_t *conn, const char *buf, size_t len) } } errno = 0; +#ifdef WITH_SSL if (conn->ssl != NULL) wlen = SSL_write(conn->ssl, buf, len); else +#endif wlen = write(conn->sd, buf, len); if (wlen == 0) /* we consider a short write a failure */ |