[sword-svn] r2696 - trunk/src/mgr
scribe at crosswire.org
scribe at crosswire.org
Tue Apr 24 22:19:01 MST 2012
Author: scribe
Date: 2012-04-24 22:19:01 -0700 (Tue, 24 Apr 2012)
New Revision: 2696
Modified:
trunk/src/mgr/curlhttpt.cpp
trunk/src/mgr/installmgr.cpp
Log:
added HTTPS option for install source, contributed by Greg Hellings.
Modified: trunk/src/mgr/curlhttpt.cpp
===================================================================
--- trunk/src/mgr/curlhttpt.cpp 2012-04-01 23:20:19 UTC (rev 2695)
+++ trunk/src/mgr/curlhttpt.cpp 2012-04-25 05:19:01 UTC (rev 2696)
@@ -144,6 +144,9 @@
/* Switch on full protocol/debug output */
curl_easy_setopt(session, CURLOPT_VERBOSE, true);
+ /* Disable checking host certificate */
+ curl_easy_setopt(session, CURLOPT_SSL_VERIFYPEER, false);
+
/* FTP connection settings */
#if (LIBCURL_VERSION_MAJOR > 7) || \
Modified: trunk/src/mgr/installmgr.cpp
===================================================================
--- trunk/src/mgr/installmgr.cpp 2012-04-01 23:20:19 UTC (rev 2695)
+++ trunk/src/mgr/installmgr.cpp 2012-04-25 05:19:01 UTC (rev 2696)
@@ -147,6 +147,7 @@
ConfigEntMap::iterator sourceEnd;
if (confSection != installConf->Sections.end()) {
+
sourceBegin = confSection->second.lower_bound("FTPSource");
sourceEnd = confSection->second.upper_bound("FTPSource");
@@ -169,6 +170,18 @@
is->localShadow = (SWBuf)privatePath + "/" + is->uid;
sourceBegin++;
}
+
+ sourceBegin = confSection->second.lower_bound("HTTPSSource");
+ sourceEnd = confSection->second.upper_bound("HTTPSSource");
+
+ while (sourceBegin != sourceEnd) {
+ InstallSource *is = new InstallSource("HTTPS", sourceBegin->second.c_str());
+ sources[is->caption] = is;
+ SWBuf parent = (SWBuf)privatePath + "/" + is->uid + "/file";
+ FileMgr::createParent(parent.c_str());
+ is->localShadow = (SWBuf)privatePath + "/" + is->uid;
+ sourceBegin++;
+ }
}
defaultMods.clear();
@@ -282,7 +295,7 @@
trans = createFTPTransport(is->source, statusReporter);
trans->setPassive(passive);
}
- else if (is->type == "HTTP") {
+ else if (is->type == "HTTP" || is->type == "HTTPS") {
trans = createHTTPTransport(is->source, statusReporter);
}
transport = trans; // set classwide current transport for other thread terminate() call
@@ -295,7 +308,17 @@
trans->setPasswd(p);
}
- SWBuf urlPrefix = (SWBuf)((is->type == "HTTP") ? "http://" : "ftp://") + is->source;
+ SWBuf urlPrefix;
+ if (is->type == "HTTP") {
+ urlPrefix = (SWBuf) "http://";
+ }
+ else if (is->type == "HTTPS") {
+ urlPrefix = (SWBuf) "https://";
+ }
+ else {
+ urlPrefix = (SWBuf) "ftp://";
+ }
+ urlPrefix.append(is->source);
// let's be sure we can connect. This seems to be necessary but sucks
// SWBuf url = urlPrefix + is->directory.c_str() + "/"; //dont forget the final slash
More information about the sword-cvs
mailing list