diff options
author | Nick White <git@njw.name> | 2015-07-28 16:20:28 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2015-07-28 16:20:28 +0100 |
commit | 93d17e32d2c64a187bda4e4c7b0162072ab77c9c (patch) | |
tree | fca76e0fe070609572a676866f887eca76cd59a0 /util.h | |
parent | 0e05096f98d957d90a59eff0b5a081d112fd329f (diff) |
Add SSL support using OpenSSL, and enable it for getgbook.
This fixes the problem with getgbook not finding any books, and
also obviously adds SSL, which is great!
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -1,7 +1,14 @@ /* See COPYING file for copyright and license details. */ #define COOKIEMAX 1024 -int dial(char *host, char *port); -int get(char *host, char *path, char *sendcookie, char *savecookie, char **body, int istext); -int post(char *host, char *path, char *sendcookie, char *savecookie, char *data, char **body, int istext); -int gettofile(char *host, char *url, char *sendcookie, char *savecookie, char *savepath, int istext); +#include <openssl/ssl.h> +#include <openssl/err.h> +typedef struct { + int fd; + SSL *sslhandle; + SSL_CTX *sslcontext; +} conn; +conn *dial(char *host, char *port, int ssl); +int get(char *host, int ssl, char *path, char *sendcookie, char *savecookie, char **body, int istext); +int post(char *host, int ssl, char *path, char *sendcookie, char *savecookie, char *data, char **body, int istext); +int gettofile(char *host, int ssl, char *url, char *sendcookie, char *savecookie, char *savepath, int istext); int renameifjpg(char *path); |