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 /getbnbook.c | |
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 'getbnbook.c')
-rw-r--r-- | getbnbook.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/getbnbook.c b/getbnbook.c index 6fa247f..a63416d 100644 --- a/getbnbook.c +++ b/getbnbook.c @@ -15,6 +15,7 @@ " -n download pages from numbers in stdin\n" \ " otherwise, all available pages will be downloaded\n" +#define USESSL 0 #define URLMAX 1024 #define STRMAX 1024 #define MAXPAGES 9999 @@ -38,7 +39,7 @@ int getpagelist() snprintf(url, URLMAX, "/DigBooks/viewer/bookviewmanager.aspx?op=getbookinfo&ean=%s", bookid); - if(!get("search2.barnesandnoble.com", url, cookies, NULL, &buf, 1)) + if(!get("search2.barnesandnoble.com", USESSL, url, cookies, NULL, &buf, 1)) return 1; /* find page url structure */ @@ -81,7 +82,7 @@ int getpage(int pagenum) s=strchr(urlpath+7, '/'); snprintf(pageurl, STRMAX, s, pagenum); - if(gettofile("search2.barnesandnoble.com", pageurl, cookies, NULL, path, 0)) { + if(gettofile("search2.barnesandnoble.com", USESSL, pageurl, cookies, NULL, path, 0)) { fprintf(stderr, "%d failed\n", pagenum); return 1; } @@ -113,7 +114,7 @@ int main(int argc, char *argv[]) bookdir = argv[argc-1]; /* get cookie */ - if(get("www.barnesandnoble.com", "/", NULL, cookies, &tmp, 0)) + if(get("www.barnesandnoble.com", USESSL, "/", NULL, cookies, &tmp, 0)) free(tmp); if(getpagelist()) { |