summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-12-03 14:41:08 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-12-03 14:41:08 +0000
commit4156debe5cdb617e25f6c974c95270dc1ce345de (patch)
treedd794abdead6be0b2e18baaf496e61af05d18d5b /src/main.cc
parent854660005dc8394ee9df5eba143b3e8d95140688 (diff)
2009-12-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --interface option. This feature binds sockets to given interface. You can specify interface name, IP address and hostname. * configure.ac * src/OptionHandlerFactory.cc * src/SocketCore.cc * src/SocketCore.h * src/main.cc * src/message.h * src/prefs.cc * src/prefs.h * src/usage_text.h
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cc b/src/main.cc
index 99dba3e1..79d3a5e1 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -208,6 +208,12 @@ downloadresultcode::RESULT main(int argc, char* argv[])
MessageDigestHelper::staticSHA1DigestInit();
#endif // ENABLE_MESSAGE_DIGEST
+ // Bind interface
+ if(!op->get(PREF_INTERFACE).empty()) {
+ std::string interface = op->get(PREF_INTERFACE);
+ SocketCore::bindAddress(interface);
+ }
+
#ifdef SIGPIPE
util::setGlobalSignalHandler(SIGPIPE, SIG_IGN, 0);
#endif