Commit Graph
41 Commits
Author SHA1 Message Date
louiz’ f89361c370 Provide a --help option
fix #3183
2016-07-31 18:16:29 +02:00
louiz’ 085a48ea48 Do not use the logger before the configuration has been loaded first 2016-07-28 11:56:33 +02:00
louiz’ db503b23e8 Use log_error instead of cerr 2016-07-24 20:03:34 +02:00
louiz’ 4c1b9abe7e Properly catch and handle database errors
Do not use a singleton for the database.

fix #3203
2016-07-12 00:31:57 +02:00
louiz’ e8671042f7 Improve the signal handling by disabling them while an handler is running 2016-06-14 12:15:31 +02:00
louiz’ 46ff73662c Clean the Config module, use static things instead of a stupid singleton 2016-06-14 03:02:36 +02:00
Florent Le Coz 9167cdf126 Notify systemd when the process is stopping 2015-12-23 11:05:55 +01:00
Florent Le Coz 33fa1dcd5a Also a xdg_data_path 2015-09-18 21:50:54 +02:00
Florent Le Coz ea0b2f2bb8 Create a xdg_path function 2015-09-18 09:20:15 +02:00
Florent Le Coz 810ea19fe3 Exit with 1 if the connection to the XMPP server fails
This helps the system understand if the process started correctly or not,
when systemd is not used

fix #3078
2015-06-10 16:47:13 +02:00
Florent Le Coz 897b281e67 Avoid some potential race conditions by blocking the signals we manage
They are atomically unblocked in the ppoll/epoll_pwait calls, avoiding any
race condition on the check of the “stop” or “reload” booleans.
2015-05-27 23:44:23 +02:00
Emmanuel Gil Peyrot e24ed4f70c Make sure XDG_CONFIG_HOME is absolute, as per XDG basedir spec. 2015-05-04 17:08:08 +02:00
Emmanuel Gil Peyrot ac30733800 Search for the config file in $XDG_CONFIG_DIR/biboumi.
This environment variable points to the location the user expects to
find every program’s config file, or if it isn’t set, ~/.config/biboumi
(with a fallback to . if $HOME isn’t set).

fix #2553
2015-05-04 16:50:35 +02:00
Florent Le Coz 6a28bde1dd Reset the signal handlers when SIGINT or SIGTERM is received
To avoid doing a double exit when receiving bot SIGINT and SIGTERM
2015-04-20 23:58:05 +02:00
Florent Le Coz d5324ac778 Re-order a few things in main.cpp 2015-04-13 01:53:53 +02:00
Florent Le Coz 33cdc6010e Set the default value to biboumi.cfg 2015-03-04 05:56:08 +01:00
Florent Le Coz d600a2843f Remove all the libs that are now in louloulibs 2015-02-27 12:26:48 +01:00
Florent Le Coz 7115aa3b7f Add a reload add-hoc command 2015-02-24 16:28:30 +01:00
Florent Le Coz b86547dc1e Implement async DNS resolution using c-ares
fix #2533
2015-02-23 13:56:08 +01:00
Florent Le Coz a50ca30e76 Use a timer to try reconnecting to the XMPP server only each 2 seconds
When the connection is lost, immediately try to reconnect, then try to
reconnect every 2 seconds.  This is much better than the previous “Try to
re-connect as fast as possible”.
2015-02-21 06:45:11 +01:00
Florent Le Coz 03a8accc46 Fix “connections” typo 2015-02-21 05:30:36 +01:00
Florent Le Coz ae469c21ff Fix “cleanely” typo 2015-02-21 05:28:21 +01:00
Florent Le Coz 04d999168a Add a level of inheritance above SocketHandler
SocketHandler has been renamed to TCPSocketHandler
SocketHandler is now a simple interface with a few methods, used only by
Poller.

This way we can inherite from the new SocketHandler class, to handle other
types of sockets, and still make them manageable by the poller without any
change in the Poller class.
2014-07-02 03:01:09 +02:00
Florent Le Coz 5c9d2c23ba TimedEventsManager is now a singleton 2014-05-30 15:51:43 +02:00
Florent Le Coz d9d30dd782 Use a timed event to force the exit 2 seconds after an exit signal is received
fix #2469
2014-05-28 17:31:28 +02:00
Florent Le Coz 5507adbe94 SocketHandlers own the poller and add themself into it only when the socket is created
We want to call socket() with the parameters provided by getaddrinfo, so we
can’t addd the fd into the poller immediately. We need to wait the
connection attempt, and then the SocketHandler can call add_socket_handler
itself, if the connection succeeds, or is in progress.
2014-05-27 01:01:44 +02:00
Florent Le Coz cdc3183d9e Introduce two new bool, to know if the xmpp component should try to reconnect
If we never succeeded our connection+auth process, means we should probably
not attempt any-more, and just give up.  If we ever did, this means a
reconnect is a good idea
2014-03-24 20:39:59 +01:00
Florent Le Coz ffc820e234 Reconnected immediately to the XMPP whenever it closes the connection 2014-03-24 20:31:02 +01:00
Florent Le Coz 5f82c93754 Use store() instead of operator=() for std::atomic<bool> objects 2014-02-24 21:02:21 +01:00
Florent Le Coz 99aba5667d Connection to servers does not block the process anymore 2014-02-22 21:42:24 +01:00
Florent Le Coz 6804f31546 Set sigaction.sa_flags to 0 2014-02-19 02:38:58 +01:00
Florent Le Coz 8fd2746696 Reload the conf on SIGUSR1/2 2014-02-19 02:24:00 +01:00
Florent Le Coz e8e592d1ac Remove disconnected IrcClients 2014-01-04 01:59:35 +01:00
Florent Le Coz 3afb63a650 Shutdown cleanly on SIGINT 2014-01-04 01:59:14 +01:00
Florent Le Coz df59a09163 Do not mismatch password and hostname in the config error help message 2013-12-24 14:04:12 +01:00
Florent Le Coz b60cbda4f9 Read the served hostname from the config file 2013-11-12 22:35:27 +01:00
Florent Le Coz f0d9273da6 Add a Config module, and use it to get the password from a file 2013-11-10 20:47:11 +01:00
Florent Le Coz ccebe901d7 Check UTF-8 encoding, and convert strings to UTF-8
Handle conversion errors properly by inserting � instead.  Add a binary
header to provide portable way to write binary literals (I like them) Also
add a test file.  ref #2404
2013-11-09 06:01:47 +01:00
Florent Le Coz bf7b05ef72 Implement the Bridge class to translate between the two protocols
Add all useful classes as well: Jid, Iid, IrcChannel, IrcUser etc to
properly keep the informations about what we receive from the IRC server.

Only handle the MUC join stanza, and send the list of users in the IRC
channel to the XMPP user, and the IRC channel’s topic, for now.
2013-11-06 21:01:18 +01:00
Florent Le Coz 87aaacdb42 Rename libirc and libxmpp to irc and xmpp 2013-11-03 00:22:32 +01:00
Florent Le Coz 64c1b28ce2 Add some dummy main 2013-11-02 03:23:17 +01:00