summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-05-21 11:36:51 +0200
committerJonas Smedegaard <dr@jones.dk>2017-05-21 11:36:51 +0200
commitb635a2d52df53ab2cfc7dd248aaef7c90cc7ecc7 (patch)
tree662c8b590d710fd594b11bd6f8feefe0d1cfa101 /src
parentef0b63d85cde3904d6d4175d56bf905fa6ece23f (diff)
parentde62b6456bebd130f98ce6192cd63ff42e654fac (diff)
downloadbiboumi-b635a2d52df53ab2cfc7dd248aaef7c90cc7ecc7.tar.gz
biboumi-b635a2d52df53ab2cfc7dd248aaef7c90cc7ecc7.tar.bz2
biboumi-b635a2d52df53ab2cfc7dd248aaef7c90cc7ecc7.tar.xz
biboumi-b635a2d52df53ab2cfc7dd248aaef7c90cc7ecc7.zip
Merge tag 'upstream/4.3'
Upstream version 4.3 # gpg: Signature made Sun May 21 11:36:48 2017 CEST # gpg: using RSA key 2C7C3146C1A00121 # gpg: Good signature from "Jonas Smedegaard <dr@jones.dk>" # gpg: aka "Jonas Smedegaard <jonas@homebase.dk>" # gpg: aka "Jonas Smedegaard <js@debian.org>" # gpg: aka "[jpeg image of size 4165]"
Diffstat (limited to 'src')
-rw-r--r--src/irc/irc_client.cpp5
-rw-r--r--src/main.cpp15
2 files changed, 15 insertions, 5 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index b0d3a47..de6b089 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -182,6 +182,11 @@ void IrcClient::start()
{
if (this->is_connecting() || this->is_connected())
return;
+ if (this->ports_to_try.empty())
+ {
+ this->bridge.send_xmpp_message(this->hostname, "", "Can not connect to IRC server: no port specified.");
+ return;
+ }
std::string port;
bool tls;
std::tie(port, tls) = this->ports_to_try.top();
diff --git a/src/main.cpp b/src/main.cpp
index 019dff0..488032d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -12,7 +12,9 @@
#include <atomic>
#include <signal.h>
-#include <litesql.hpp>
+#ifdef USE_DATABASE
+# include <litesql.hpp>
+#endif
// A flag set by the SIGINT signal handler.
static std::atomic<bool> stop(false);
@@ -83,11 +85,14 @@ int main(int ac, char** av)
if (hostname.empty())
return config_help("hostname");
+
+#ifdef USE_DATABASE
try {
- open_database();
- } catch (const litesql::DatabaseError&) {
- return 1;
- }
+ open_database();
+ } catch (const litesql::DatabaseError&) {
+ return 1;
+ }
+#endif
// Block the signals we want to manage. They will be unblocked only during
// the epoll_pwait or ppoll calls. This avoids some race conditions,