diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2002-06-05 21:35:35 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2002-06-05 21:35:35 +0000 |
| commit | 3070f6cb064bd947d7bb60f555f9e6e9c2d5ad20 (patch) | |
| tree | 0509c1c0fc4b92c600c8202a518165929fa017e2 /lib/libfetch/common.c | |
| parent | eb5cb11b701be7e684b8dcd1775dba39a0b0e917 (diff) | |
Notes
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 775b4c74af61..c234fab6a410 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 */ |
