Commit Graph

21 Commits

Author SHA1 Message Date
Tobias Blomberg 1114ac3cec Host lookups did not work for hosts file 2022-04-03 20:50:16 +02:00
Tobias Blomberg b47fcfb0fb ReflectorLogic: Client side redundancy added
ReflectorLogic: Client side redundancy added by using DNS SRV records or
a locally specified list of hosts. Renamed configuration variables:
HOST -> HOSTS, PORT -> HOST_PORT. New configuration variables:
DNS_DOMAIN, HOST_PRIO, HOST_PRIO_INC, HOST_WEIGHT.

Rewritten the DNS resolver with support for more resource record types.
Specifically SRV record support were needed to implement the reflector
client side redundancy.

New class Async::TcpPrioClient for handling pools of servers to connect to.
The pool members can be specified using DNS SRV records or locally using the
HOSTS configuration variable.

New class Async::StateMachine used to build Hierarchial Finate State
Machines.

Add a new method, Async::TcpClientBase::remoteHostName(), so that we can
find out what hostname we used in the connect call.

Rename Async::TcpClientBase bind to setBindIp. Also add a bindIP()
method to access the bind address.
2022-03-27 21:20:46 +02:00
Tobias Blomberg 45dc57e1b5 Improve flawed reimplementation of DNS lookup
Pull request #202 implement a variant on DNS lookup in
AsyncCppDnsLookupWorker. That reimplementation had a couple of flaws
that this commit should fix.

- The new implementation would not sort out IPv6 answers and produced a
lot of duplicates due to getaddrinfo returning results for multiple
protocols and socket types.
- The new implementation may have had data races after removing the
mutexes. A pthread_join before accessing the shared data should take
care of this problem.
- Improved error/warning messages
2017-01-07 21:36:55 +01:00
Adi Bier/DL1HRC 9010fc7158 small bugfix in AsyncCppDnsLookupWorker class 2016-06-09 19:46:46 +02:00
Adi Bier/DL1HRC a5847b8b10 bugfix: SvxLink terminates frequently when connected on low quality mobile internet connection. Removed an assert in AsyncTcpConnection handler.\r\nbugfix: removed mutexes from DnsLookupWorker, mutex leaves locked on DNS timeout. 2016-06-04 14:26:22 +02:00
Tobias Blomberg 100d246d9a Fix coverity scan issue 79016
Uninitialized pointer field -- The pointer field will point to an
arbitrary memory location, any attempt to write may cause corruption.
In Async::CppDnsLookupWorker::CppDnsLookupWorker: A pointer field is not
initialized in the constructor (CWE-457)
2015-01-21 19:39:25 +01:00
Tobias Blomberg 79bf8643eb * Added missing include file. Build failed with gcc 4.7.1 according to
Tom / DL1JBE.


git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@2198 f8843c6b-282e-0410-804b-c0d5895947d2
2012-08-02 20:41:25 +00:00
Tobias Blomberg 05c0dfd70c * Merged the latest changes from trunk into the sigc++2 task branch.
git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/branches/sigc++2@2131 f8843c6b-282e-0410-804b-c0d5895947d2
2011-11-06 13:22:33 +00:00
Tobias Blomberg a50327dac4 * Merged the latest changes in the 11.11 release branch into trunk.
git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@2126 f8843c6b-282e-0410-804b-c0d5895947d2
2011-11-05 16:47:48 +00:00
Tobias Blomberg f37128ba96 * Fixed a small problem in the MultiTx cleanup code. The bug could cause
SvxLink to crash upon exiting the application but should otherwise
  have casued no problems.

* Fixed an erroneous printout.


git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@2113 f8843c6b-282e-0410-804b-c0d5895947d2
2011-10-16 15:01:57 +00:00
Tobias Blomberg 7dffed94cb - First checkin of the libsigc++-2.0 patch contributed by Felix.
Everything compiles. Not tested much yet but it seems to work just fine.


git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/branches/sigc++2@2060 f8843c6b-282e-0410-804b-c0d5895947d2
2011-08-28 22:24:14 +00:00
Tobias Blomberg 3d6ae29881 Now compiles cleanly under Fedora 11.
git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@1607 f8843c6b-282e-0410-804b-c0d5895947d2
2009-06-29 20:30:38 +00:00
Tobias Blomberg 2b1cfaed1a Fixed a couple of warnings.
Documentation touch up.


git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@1580 f8843c6b-282e-0410-804b-c0d5895947d2
2009-04-26 09:17:53 +00:00
Tobias Blomberg c03a9c5eea Fixed a couple of compilation issues under Fedora 9.
git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@1406 f8843c6b-282e-0410-804b-c0d5895947d2
2008-07-30 10:15:04 +00:00
Tobias Blomberg 6ad9dd990f Fixed a problem in the AsyncCppDnsLookupWorker class. A local variable
had been declared as "struct in_addr *h_addr". The problem was that
in the system include file "h_addr" is defined as a macro resolving
to "h_addr_list[0]" so the local declaration would be converted to
"struct in_addr *h_addr_list[0]". That is a list of size 0 of
pointers to "struct in_addr *". Not good...


git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@1391 f8843c6b-282e-0410-804b-c0d5895947d2
2008-07-14 14:44:20 +00:00
Tobias Blomberg 4f4f024997 Bugfix: Made Async::CppDnsLookupWorker thread safe.
git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@1324 f8843c6b-282e-0410-804b-c0d5895947d2
2008-05-18 08:40:44 +00:00
Tobias Blomberg 8ac3b9eb24 Moved on from libsigc++ 1.0 to 1.2. SvxLink will no longer compile with
version 1.0.


git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@953 f8843c6b-282e-0410-804b-c0d5895947d2
2006-11-07 20:44:20 +00:00
Tobias Blomberg 892705b6f9 Fixed pthread error handling.
Fixed an illegal call to pthread_cancel.


git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@586 f8843c6b-282e-0410-804b-c0d5895947d2
2005-05-15 21:25:54 +00:00
Tobias Blomberg 921514b650 Made DNS lookups non blocking by doing the actual lookup in a separate
thread.


git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@559 f8843c6b-282e-0410-804b-c0d5895947d2
2005-04-12 19:45:34 +00:00
Tobias Blomberg a8be797e7d Bugfix: Found some serious memory handling bugs. Thank you valgrind!
git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@396 f8843c6b-282e-0410-804b-c0d5895947d2
2004-09-05 11:46:02 +00:00
Tobias Blomberg a9b2a30098 Initial revision
git-svn-id: svn://svn.code.sf.net/p/svxlink/svn/trunk@4 f8843c6b-282e-0410-804b-c0d5895947d2
2003-07-06 00:06:42 +00:00