louiz’
ffb402f0ad
Drop support for botan < 2.0
...
fix #3274
2017-07-20 21:22:58 +02:00
louiz’
faed8952cb
Remove a bunch of useless string_literal usage
2017-07-08 14:04:35 +02:00
louiz’
da55060840
Improve the handling of the biboudb.hpp dependencies
2017-05-10 16:50:11 +02:00
louiz’
f7e4adb10b
Avoid any potential int overflow
2017-05-09 15:46:20 +02:00
louiz’
7b3e0e0cf3
Make botan’s policy configurable from a file
...
fix #3244
2017-04-30 15:14:54 +02:00
louiz’
cf87cf0892
Better way to init the msghdr fields
2017-04-20 15:44:46 +02:00
louiz’
69fd6cc4c3
Explicitely init the msghdr fields, to be compatible with any implementation
2017-04-20 19:14:59 +02:00
louiz’
8a912ea3a3
Apply a few clang-tidy cppcoreguidelines-* fixes
2017-04-07 11:10:51 +02:00
louiz’
be9c577de8
Apply all the clang-tidy performance-* fixes
2017-04-07 19:01:49 +02:00
louiz’
ccb4ee098f
Apply all the clang-tidy misc-* fixes
2017-04-07 18:53:12 +02:00
louiz’
5402a256d1
Apply all the clang-tidy modernize-* fixes
2017-04-07 18:45:24 +02:00
louiz’
1a09c965eb
Remove two sneaky log_debug
2017-03-29 23:32:43 +02:00
louiz’
0ab40dc1ab
Refactoring louloulibs and cmake
...
Use OBJECT libraries
Remove the louloulibs directory
Write FOUND variables in the cache
2017-03-14 21:45:23 +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
b86547dc1e
Implement async DNS resolution using c-ares
...
fix #2533
2015-02-23 13:56:08 +01:00
Florent Le Coz
a17135720e
Fix typo
2015-02-22 18:00:35 +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
4069c5e4ac
Add a missing #include for sockaddr_in6
2015-01-26 21:15:09 +01:00
Florent Le Coz
720e31a511
Fix a few issues reported by static analyzers
2014-12-17 13:37:57 +01:00
Florent Le Coz
609722b4e7
Merge branch 'v1'
...
Conflicts:
src/network/socket_handler.hpp
2014-07-15 15:56:37 +02:00
Florent Le Coz
6a4e17cb0a
Fix IPv6 support (sockaddr size)
...
Since struct sockaddr is too small to contain an IPv6, we use struct
sockaddr_in6 instead, and we cast it where needed
2014-07-15 15:50:35 +02:00
Florent Le Coz
11a31db2d5
Send the reason of the connection close to the user
2014-07-15 15:39:25 +02:00
Florent Le Coz
8c34576ea0
Move some members of TCPSocketHandler into the SocketHandler class
2014-07-03 03:31:50 +02: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
7b785cf552
Delete the timeout event using the correct socket number, instead of -1
...
Was causing the event to not be removed in case of connection failure, which
lead to a dangling timed event named “timeout-1”, which was called later, by
some other SocketHandler for which even the socket creation failed (so, its
socket is -1), with a pointer to the previous SocketHandler which has
disappeared for a long time: segmentation fault etc.
2014-06-22 23:56:51 +02:00
Florent Le Coz
77fe8b89a3
Make the Botan rng, credential_manager etc be static
...
This actually makes the session_manager be useful, and saves a few octets of
memory for the other ones
2014-06-19 01:04:40 +02:00
Florent Le Coz
8b30e312bb
Add a TimedEvent to cancel the connection to a server after 5 seconds
2014-06-08 15:13:08 +02:00
Florent Le Coz
23f32ba39e
Implement TLS support using Botan
...
For now, it tries two TLS ports and then connects to the non-tls port. In
the future we would like the user to be able to configure that.
fix #2435
2014-06-08 05:07:54 +02:00
Florent Le Coz
be6265544a
Make the destructor of the SocketHandler class protected non-virtual
2014-06-05 02:24:03 +02:00
Florent Le Coz
e033b6a3ae
On connection in-progress, save the whole addrinfo struct, not just ai_addr
2014-05-28 02:03:36 +02:00
Florent Le Coz
7b31bea75b
Only close/unmanage the socket if we are connected/connecting
...
Since the socket is now only created and managed whenever the connection is
being established, we only close the socket and if it was created (we use -1
to denote the fact that is not yet created, or has been closed) and we only
unmanage the socket if it is effectively managed.
fix #2529
2014-05-27 23:47:45 +02:00
Florent Le Coz
23e8e32f84
Support IPv6 connections
...
fix #2522
2014-05-27 01:06:45 +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
6b0ffb5fc2
If both write and read events are available on a socket, only do the read
...
Because the read handler may discover that the connection has been closed,
and then remove the socket from the poller. It that case it is no longer
valid to try to call the write handler (which may try to reconnect, but
since that socket is no longer managed, this is not OK).
2014-05-26 22:27:43 +02:00
Florent Le Coz
28d244631d
Add missing std::string_literals
2014-04-29 23:51:32 +02:00
Florent Le Coz
f6e6b8905b
Use C++14 string_literals
2014-04-29 21:50:13 +02:00
Florent Le Coz
58a2c00d44
Call on_connection_failed() when the connection fails to be established
2014-04-15 06:47:38 +02:00
Florent Le Coz
f7b75d7eb4
Remove a useless debug log line
2014-04-15 06:42:00 +02: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
e196d2f1f4
Do not send data if we are connected, send it only once we actually are
2014-03-24 18:37:31 +01:00
Florent Le Coz
930696e48a
Remove useless cast
2014-03-10 00:12:42 +01:00
Florent Le Coz
601159e8e2
Fix a bus error by not going above an array boundary
2014-03-03 21:02:55 +01:00
Florent Le Coz
86d4347af8
Avoid unnecessary copies by recv()ing data directly into the expat buffer
2014-02-28 01:14:38 +01:00
Florent Le Coz
df774d45a9
Use scatter/gather io with sendmsg to avoid concataning strings all the time
2014-02-27 23:43:05 +01:00
Florent Le Coz
e2b9e80244
Fix a wrong comment
2014-02-26 01:15:44 +01:00
Florent Le Coz
541af5236e
Consider that the connect() succeded if errno EISCONN
...
Apparently on some systems, subsquent connect() calls may fail with EISCONN
error, to indicate that the connection succeded in the background, instead
of returning 0.
2014-02-22 23:36:03 +01:00
Florent Le Coz
730cc6e1bd
Save the addrinfo values for reuse on subsequent connect() call
2014-02-22 23:35:14 +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
e390b79a12
Do not receive SIGPIPE when send() is called on a closed socket
...
The error is handled using the return value
2014-02-20 00:00:05 +01:00
Florent Le Coz
16be9af3fc
Send unavailable presence to all muc when the IRC server closes the connection
2014-02-19 23:59:43 +01:00