Check some unsanitized network inputs before allocating memory using them.
Extract constants.h
Don't throw an exception if reading a encode server response fails (#2320).
Avoid boost::bind()ing a shared_ptr.
Fix some dubious thread/locking behaviour. Previously we had server_found(), which took the lock and found a server, which it returned as an iterator into the list. However, it then released the lock, which I think left the iterator unprotected. This wasn't done in response to any particular bug, I just noticed it on the way past.
C++11 tidying.
Add some possibly-useful markers for debugging threads from coredumps.
BOOST_FOREACH.
std::shared_ptr
If we don't query a server (because we already know about it) the "last seen time" will never be updated, so the server will be discarded. It seems that we should always ping servers (so that set_seen gets called on receipt of the response), no matter whether "auto-discovered" or configured, so that the "discard" code doesn't kick in. Otherwise we remove and re-add our configured servers every 10 seconds, which is inefficient and which possibly triggers other bugs.
Use a foreach.
Build fixes for Boost >= 1.73 Forward-ported-from: d1e9749ca290673639a49d693a8fe5c6557cc2de
Fix bugs in thread termination causing occasional pthread assertion failures. Before this, it was possible for J2KEncoder::terminate_threads() to finish without terminating all threads if the thread _running_ terminate_threads() was itself interrupt()ed. This is because the thread_group::join_all() in terminate_threads() is an interruption point, so it was possible it not to complete but instead to throw interrupted_exception. Then the owning J2KEncoder would be torn down but the threads would still be running, causing use-after-frees. This commit adds some boost::this_thread::disable_interruption objects to ensure that the owning thread is not interrupted while it is being destroyed. Also tidy up code that does this stuff, assuming that it's safe to not call thread::joinable but instead do thread.interrupt(); try { thread.join(); } catch (...) {}
Various thread cleanups.
Fix a couple of deadlocks caused by emitting ServersListChanged with a lock on _servers_mutex; handlers to that signal may call ::servers() which tries to take a lock on the same mutex.
Tidy up to use one list of servers.
Update encoding server list when servers disappear (#1176).
Note and indicate servers with bad link version (#982).
Name threads on Linux.
Listen for server replies on different ports on main and batch, and get servers to send replies to both (#1190).