summaryrefslogtreecommitdiff
path: root/src/FeatureConfig.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-05-12 00:55:12 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-05-12 00:55:12 +0900
commit89c1916fa57d87ea09142cc3588044c691d1928f (patch)
treeea35f4171e9e5b85e7336688b6089786a9c6701d /src/FeatureConfig.cc
parent4654f1974a5faa832518ba3875ecb3e77224e656 (diff)
parent2758fba10c79a76e07f7cfb894f5cfcbaff85ff7 (diff)
Merge branch 'sftp'
Diffstat (limited to 'src/FeatureConfig.cc')
-rw-r--r--src/FeatureConfig.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/FeatureConfig.cc b/src/FeatureConfig.cc
index 1d2d30bb..1b5b183a 100644
--- a/src/FeatureConfig.cc
+++ b/src/FeatureConfig.cc
@@ -67,7 +67,9 @@
#ifdef HAVE_SYS_UTSNAME_H
# include <sys/utsname.h>
#endif // HAVE_SYS_UTSNAME_H
-
+#ifdef HAVE_LIBSSH2
+# include <libssh2.h>
+#endif // HAVE_LIBSSH2
#include "util.h"
namespace aria2 {
@@ -80,6 +82,8 @@ uint16_t getDefaultPort(const std::string& protocol)
return 443;
} else if(protocol == "ftp") {
return 21;
+ } else if(protocol == "sftp") {
+ return 22;
} else {
return 0;
}
@@ -166,6 +170,14 @@ const char* strSupportedFeature(int feature)
#endif // !ENABLE_XML_RPC
break;
+ case(FEATURE_SFTP):
+#ifdef HAVE_LIBSSH2
+ return "SFTP";
+#else // !HAVE_LIBSSH2
+ return nullptr;
+#endif // !HAVE_LIBSSH2
+ break;
+
default:
return nullptr;
}
@@ -221,6 +233,11 @@ std::string usedLibs()
#ifdef HAVE_LIBCARES
res += "c-ares/" ARES_VERSION_STR " ";
#endif // HAVE_LIBCARES
+
+#ifdef HAVE_LIBSSH2
+ res += "libssh2/" LIBSSH2_VERSION " ";
+#endif // HAVE_LIBSSH2
+
if(!res.empty()) {
res.erase(res.length()-1);
}