diff options
Diffstat (limited to 'src/mgr/curlhttpt.cpp')
-rw-r--r-- | src/mgr/curlhttpt.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mgr/curlhttpt.cpp b/src/mgr/curlhttpt.cpp index 5db0ee7..b9219a0 100644 --- a/src/mgr/curlhttpt.cpp +++ b/src/mgr/curlhttpt.cpp @@ -2,7 +2,7 @@ * * curlhttpt.cpp - CURLHTTPTransport * - * $Id: curlhttpt.cpp 2980 2013-09-14 21:51:47Z scribe $ + * $Id: curlhttpt.cpp 3515 2017-11-01 11:38:09Z scribe $ * * Copyright 2004-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society @@ -55,12 +55,12 @@ namespace { return -1; /* failure, can't open file to write */ } if (out->destBuf) { - int s = out->destBuf->size(); + int s = (int)out->destBuf->size(); out->destBuf->size(s+(size*nmemb)); memcpy(out->destBuf->getRawData()+s, buffer, size*nmemb); - return nmemb; + return (int)nmemb; } - return fwrite(buffer, size, nmemb, out->stream); + return (int)fwrite(buffer, size, nmemb, out->stream); } @@ -141,7 +141,9 @@ char CURLHTTPTransport::getURL(const char *destPath, const char *sourceURL, SWBu curl_easy_setopt(session, CURLOPT_CONNECTTIMEOUT, 45); /* Disable checking host certificate */ - curl_easy_setopt(session, CURLOPT_SSL_VERIFYPEER, false); + if (isUnverifiedPeerAllowed()) { + curl_easy_setopt(session, CURLOPT_SSL_VERIFYPEER, false); + } /* FTP connection settings */ @@ -215,7 +217,7 @@ vector<struct DirEntry> CURLHTTPTransport::getDirList(const char *dirURL) { pBufRes = (char *)strchr(pBuf, '\"');//Find the end of the possible file name if (!pBufRes) break; - possibleNameLength = pBufRes - pBuf; + possibleNameLength = (int)(pBufRes - pBuf); possibleName.setFormatted("%.*s", possibleNameLength, pBuf); if (isalnum(possibleName[0])) { SWLog::getSystemLog()->logDebug("getDirListHTTP: Found a file: %s", possibleName.c_str()); |