Releases: jfriesne/muscle
Releases · jfriesne/muscle
9.20 release
9.20 - Released 12/30/2022
- Updated NetworkUtilityFunctions.cpp to better support "real"
IPv4 sockets (previously it assumed that IPv4 traffic would
be handled using IPv6 sockets and IPv4-mapped IPv6 addresses,
but that approach doesn't give 100% compatibility in all cases) - Added a GetSocketFamily() method to the Socket class.
- Added an optional (socketFamily) argument to CreateUDPSocket().
- Added IsOK(io_status_t &) and IsError(io_status_t &) method
overrides to the io_status_t class. - hexterm now instantiates a genuine IPv4 socket for use with
IPv4 multicast traffic. - Tweaked gz*.c includes to compile without a configuration step.
- Added input-data-timestamping (including a PR_NAME_DATA_TIMESTAMP
field and SetReceiveTimestampingEnabled() and
GetReceiveTimestampingEnabled() methods) to the
RawDataMessageIOGateway class. - Added SetLogLevelThreshold() and GetLogLevelThreshold() arguments
to the LogCallback class so that any LogCallback can now specify
what log-levels it is (or is not) interested in. - Added templated overloads of Message::FindFlat(), Message::FindTag()
Message::GetFlat(), and Message::GetTag() that take any type of Ref
as an argument, so calling code no longer has to pass in a generic
RefCountableRef or FlatCountableRef and then do the necessary
downcasting separately afterward. - Message::FindTag() now takes a ConstRefCountableRef as an
argument rather than a RefCountableRef, for better flexibility. - Added templated overloads of Message::AddFlat(), PrependFlat(),
ReplaceFlat(), AddTag(), PrependTag(), and ReplaceTag() so that
the calling code no longer has to do manual upcasting of typed
FlatCountableRef or RefCountableRef objects before calling them. - Added ConstMessageRef overloads of InflateMessage() and DeflateMessage().
- Added a ConstMessageRef-returning overload of Message::FindMessage().
- Removed the ByteBufferRef-specific *Flat() methods from
the Message class, since we now have more general templatized
methods that offer the same semantics for any type. - SocketMultiplexer::WaitForEvents() now returns an io_status_t
rather than an int, for better error-reporting. - Merged the IPv6 and IPv4 versions of AddSocketToMulticastGroup()
and RemoveSocketFromMulticastGroup() so that a single implementation
can work on either type of socket. - Renamed SetSocketMulticastSendInterfaceAddress() and
GetSocketMulticastSendInterfaceAddress() to
SetIPv4SocketMulticastSendInterfaceAddress() and
GetIPv4SocketMulticastSendInterfaceAddress(), respectively,
and made them available even when -DMUSCLE_AVOID_IPV6 isn't set. - Renamed Log() to LogPlain().
- Made LogTime() and LogPlain() into macros so that their arguments
will not be evaluated unless the logging-threshold-test passes. - Improved error reporting in the ReflectServer event-loop.
- Removed the functions from TimeUnitConversions.h that take
(struct timeval &) as their argument, since they weren't being used. - Removed SetConsoleLogLevel() and GetConsoleLogLevel() from the
DefaultConsoleLogger class, in favor of the new equivalent methods
in the LogCallback base class. - Removed SetFileLogLevel() and GetFileLogLevel() from the
DefaultFileLogger class, in favor of the new equivalent methods
in the LogCallback base class. - Renamed muscle's private namespaces to muscle_private.
- Replaced long with int32 in some I/O support functions.
- The default ByteBufferPool now clears the IMemoryAllocationStrategy
field of any ByteBuffer it recycles (after freeing its memory),
to avoid polluting the pool with user-installed strategies. - Ref::SetFromRefCountableRef() now returns B_TYPE_MISMATCH on failure
rather than B_BAD_ARGUMENT. - Removed the two-argument ConstRef and Ref "pseudo-constuctors"
and added instead a DowncastTo() method, to
make Ref-downcasting operations self-documenting. - Changed ITraversalPruner::MatchPath() and CreateObjectFromArchiveMessage()
to take ConstMessageRef as an argument rather than MessageRef. - Changed StorageReflectSession::SetDataNode(), InsertOrderedData(),
InsertOrderedChildNode(), and GetNewDataNode() to take
ConstMessageRef as an argument rather than MessageRef. - Changed DataNode to hold a ConstMessageRef rather than a MessageRef.
- Changed StorageReflectSession::NotifySubscribersThatNodeChanged()
and StorageReflectSession::NodeChanged() to pass a ConstMessageRef
rather than a MessageRef. - ByteBuffer::ReleaseBuffer() now returns (uint8 *) instead of
(const uint8 *). - Fixed MLOG_ON_ERROR and friends to be usable with io_status_t.
- ExpandLocalhostAddress() no longer expands IPv6 loopback addresses.
- UDPSocketDataIO::ReadFrom() would call SetSourceOfLastReadPacket()
even when no packet had been read, clearing that field. Fixed. - Some functions in MuscleSupport.h were unintentionally being
declared outside the muscle namespace. Fixed.
9.10 release
9.10 - Released 12/10/2022
- Rewrote the non-Windows implementation of muscleSprintf()
to call vsnprintf() instead of sprintf(), to avoid compiler
warnings about sprintf() being insecure. - Instrumented the non-Windows implementation of muscleSprintf()
with MUSCLE_PRINTF_ARGS_ANNOTATION_PREFIX so that the compiler
will warn about calls to muscleSprintf() with the wrong format
specifiers. - Added an io_status_t class to represent the result of an I/O
operation. An io_status_t contains both a status_t and an
int32 byte-count. - Added a MUSCLE-by-example page for the status_t class.
- Added MTALLY_BYTES_OR_RETURN_ON_IO_ERROR() and
MTALLY_BYTES_OR_RETURN_ON_IO_ERROR_OR_BREAK() macros to
MuscleSupport.h.
- Changed the return-types of the NetworkUtilityFunctions that
previously returned (int32/byte-count-or-negative-1), aka
SendData(), ReceiveData(), SendDataUDP(), ReceiveDataUDP(),
ReadData(), and WriteData() to return a more informative
io_status_t instead. - Changed the DataIO::Read() and DataIO::Write() methods to
return io_status_t instead of int32. - Changed the PacketDataIO::ReadFrom() and PacketDataIO::WriteTo()
methods to return io_status_t instead of int32. - Simplified the implementation of GetDefaultObjectForType() back
to one that compile under any version of C++. We'll rely on
the optimizer to do the right thing, rather than SFINAE. - Modified Directory::SetDir() to return a static status_t value
rather than B_ERRNO, to avoid potential static-initialization
ordering problems on pre-C++11 compilers. - tagged status_t as a MUSCLE_FINAL_CLASS.
- Replaced the MAKETYPE(x) macro with a MakeWhatCode() function.
- Updated message_transceiver_thread.py to catch and ignore any
EAGAIN exceptions generated by send() on a notification-socket. - Fixed a spurious assertion failure in SimulatedMulticastDataIO.
- Changed some code to return B_IO_ERROR instead of B_ERRNO if
fread() or fwrite() fails, since those functions are not
guaranteed to set errno when they fail. - Fixed a bug that would cause GetEnvironmentVariableValue() to
sometimes return garbage strings under Windows if the environment
variable did not exist. - Added missing DOxygen parameter documentation for various
macros declared in MuscleSupport.h. - Fixed a number of broken hyperlinks in the MUSCLE-by-example docs.
9.01 release
9.01 - Released 11/18/2022
- Added a WritePaddingBytesToAlignTo(uint32 alignSize)
convenience-method to the CheckedDataFlattenerHelper
and DataFlattenerHelper classes. - Added a SeekPastPaddingBytesToAlignTo(uint32 alignSize)
convenience-method to the DataUnflattenerHelper class. - Added DataUnflattener ctor and SetBuffer() calls that
take a ByteBufferRef, for convenience. - Added a GetEnvironmentVariableValue() convenience function,
to avoid calling getenv() directly from user code. - Added %p (aka process ID) to the set of tokens expanded by
HumanReadableTimeValues::ExpandTokens(). - DefaultFileLogger::EnsureLogFileCreated() now tries a little
harder: if it can't create a log file with the given file name,
it will try up to 10 variants of the file name in the hopes
of coming up with a file name that is unique and can be created. - Added a IsBitIndexValid() convenience-method to the BitChord class.
- Added MUSCLE_CONSTEXPR_OR_CONST macro to expand to "constexpr"
if possible, or "const" otherwise. - GetDefaultObjectForType() now uses constexpr to avoid on-demand
initialization, when -DMUSCLE_USE_CPLUSPLUS17 is defined. - CMakeLists.txt now automatically specifies -DMUSCLE_USE_PTHREADS
if building on POSIX for C++03, and WITH_THREADS is ON. - LogTime() calls now emit printf-style format-usage warnings
when compiled with g++ or clang++. - Added INT16_FORMAT_SPEC_* macros, for completeness.
- PODSwapper now calls std::swap() rather than reimplementing it.
- Moved the definitions of the B_* error-codes out of SetupSystem.cpp
and into MuscleSupport.h, so that Clang's Static Analyzer can see
what values they contain and generate better output. - Generation of the random number that %r expands to is now
actually random (not just calling rand()) (in C++11 or newer). - Renamed several of the longer mkdocs examples folder names
to avoid hitting Windows' 260-character path limit. - Fixed a potential uninitialized-memory-read in the String
class's GetLevenshteinDistance() method. - Fixed the CMakeList.txt files in the sub-folders to use
the inherited CMAKE_CXX_STANDARD setting rather than
forcing C++11. - GetCurrentThreadID() is no longer compiled if
-DMUSCLE_SINGLE_THREAD_ONLY is specified.
9.00 release
Note that this is a major (.00!) release that changes several existing APIs (in particular the StringTokenizer and Flattenable/PseudoFlattenable APIs) in ways that are not backwards-compatible with 8.xx MUSCLE-calling code. If your program directly uses those APIs, you will likely need to modify your calls somewhat in order for it to build against this (and future) versions of MUSCLE.
9.00 - Released 10/27/2022
- Added a MUSCLE_MAXIMUM_NODE_DEPTH constant that limits
how deep the MUSCLE node-tree may become, to prevent
stack-overflow attacks. Defaults to 100. - Added DataFlattener and DataUnflattener classes to
allow for safer flattening/unflattening of data
to/from byte-buffers. - Added an UncheckedDataUnflattener class, for better
efficiency when the calling code has already done its
own bounds-checking. - Added a CheckedDataUnflattener class, for better
calling code that wants to use a dynamically-growing
output buffer. - Added support/EndianConverter.h to allow templating
over big/little/native endian-encoding strategies. - Added pages for DataFlattener and DataUnflattener
APIs to the muscle-by-example documentation. - Adding -DMUSCLE_USE_BIG_ENDIAN_DATA_FOR_EVERYTHING
to your compile line will tell MUSCLE to use big-endian
data format for all of its data. Note that doing so will
break interoperability with all existing MUSCLE builds! - Adding -DMUSCLE_USE_NATIVE_ENDIAN_DATA_FOR_EVERYTHING
to your compile line will tell MUSCLE to use native-endian
data format for all of its data. Note that doing so will
break compatibility with different-endian CPUs!
- Changed the PseudoFlattenable::Flatten() and
Flattenable::Flatten() methods to take a second
argument (flatSize) for better runtime error-checking. - Changed the PseudoFlattenable::Unflatten() and
Flattenable::Unflatten() methods to take a
(DataUnflattener &) as an argument rather than
a raw pointer, for better caller/callee cooperation. - Changed Message::TemplatedFlatten() to use
a DataFlattener as an argument. - Changed Message::TemplatedUnflatten() to use
a DataUnflattener as an argument. - Removed the SetEndianFlag(), Append*(), Write*(),
Read*() methods from the ByteBuffer class. Use
the new DataFlattener/DataUnflattener classes instead. - Refactored the StringTokenizer class's constructors to
take a single (optSepChars) argument instead of separate
arguments for hard and soft separator characters. - Made the calculation of DataNode depths more efficient.
- Removed Flattenable::WriteData() and Flattenable::ReadData()
methods (since DataFlattener/DataUnflattener do it better). - Replaced most calls to B_LENDIAN_TO_HOST() and
B_HOST_TO_LENDIAN() with calls to DefaultEndianConverter's
Import() and Export() methods, to allow MUSCLE to be built
in big-endian mode. - Changed the PseudoFlattenable class to be templatized, and
added methods to it so all the helper methods declared in
the Flattenable interface are also available in the
PseudoFlattenable interface. - Refactored the ZLib-support classes in muscle/zlib so that they
no longer include any zlib-headers from their header files. - Modified Snooze64() to call clock_nanosleep() under Linux,
and to call nanosleep() when -DMUSCLE_USE_LIBRT is defined. - Changed all the #include "zlib/zlib/zlib.h" directives to
#include "zlib.h" to avoid using the captive zlib headers
together with any system-supplied zlib implementation (which
might be different) - Fixed a bug that could cause ZLibDataIO::WriteAux() to
to into an infinite recursion if zlib's deflate() errored out. - Fixed a bug in MessageIOGateway that could cause it fail
to report how many bytes it had sent or received, if an
I/O error occurred later on in the same call to DoInput()
or DoOutput().
8.62 release
8.62 - Released 9/22/2022
- Added a Hashtable::ComputeInvertedTable() convenience-method.
- Added a Hashtable::ComputeValuesHistogram() convenience-method.
- Updated server/Makefile and test/Makefile to compile Universal
binaries under MacOS/X, if the BUILD_UNIVERSAL_BINARIES environment
variable is set. - Updated the captive zlib library to v1.2.12.
- Rewrote Hashtable::InsertIterationEntryInOrder() to be simpler and
more efficient in most cases. - Hashtable::Clear() wasn't updating registered HashtableIterators
properly. Fixed. - python3/message.py was calling deprecated method array.fromstring()
when it should be calledin array.frombytes(). Fixed. - python3/message.Flatten() now handles it properly when passed a
string as a raw data-item.
8.61 release
8.61 - Released 8/2/2022
- Added a GetMTU() method to the NetworkInterfaceInfo class.
- Added a BitChord::WithBitSetTo() convenience method.
- Added a snoopsharedmem program to the tests folder.
- Added an erasesharedmem program to the tests folder.
- Improved the error codes returned by methods in the SharedMemory class.
- GetSystemPath(SYSTEM_PATH_USERHOME) now falls back to calling
getpwuid() on POSIX systems, if the getenv("HOME") approach fails. - Added a WaitConditionCallbackMechanism utility class.
- Added an AtomicValue class to support lock-free variable-sharing.
- Added a SpinLock class.
- Added a PR_RESULT_NOOP code to the enum in StorageReflectConstants.h
- Added testatomicvalue.cpp to test/verify the AtomicValue class.
- Calling Write() on a UDPSocketDataIO with zero destinations no
longer results in an error-return; rather the data is discarded and
Write() returns success. - Updated copyright notices at the tops of files.
- Removed trailing spaces from all source files.
- Suppressed a compiler warning when compiling with OpenSSL support enabled.
- Modified Queue::InsertItemAt() and Queue::InsertItemsAt() to
allow insert-positions greater than the size of the Queue. Calls
like that will append the item(s) to the end of the Queue. - Added psapi.lib to Qt .pro files for Windows, so Qt programs can link.
- Fixed the Makefile in tests to compile testsharedmem by default.
- Added some missing build-executable directives to tests/CMakeLists.txt.
8.60 release
8.60 - Released 5/28/2022
- Added a WaitCondition class for easy Wait()/Notify() functionality.
- Updated the Thread class to use a WaitCondition object as a fallback
if (useMessagingSockets) is passed to the constructor as false. - Added WITH_CPLUSPLUS11=OFF and WITH_CPLUSPLUS17=ON options to the
CMakeLists.txt file. - Added a WITH_PTHREADS=ON option to the CMakeLists.txt file.
- Added B_IO_READY to the set of declared status_t error-values.
- Added example programs and documentation for the new WaitCondition
class to the muscle-by-example folder. - Updated Thread::WaitForNextMessageFromOwner(),
Thread::GetNextReplyFromInternalThread(), and MessageTransceiverThread::
GetNextEventFromInternalThread() to return status_t instead of int32. - Rephrased the message printed when the crash-signal-handler executes.
- Swapped the ordering of arguments to the Thread class's constructor.
- Added code to JUCECallbackMechanism::handleAsyncUpdate() to work around
a bug(?) in JUCE where handleAsyncUpdate() could be called re-entrantly
in certain circumstances. - qt_muscled_browser's "connected_at" field was being generated using
the wrong clock (GetRunTime64() instead of GetCurrentTime64()). Fixed. - Fixed a bug in StorageReflectSession::NodeChanged() that could cause
subscription-results to be returned upon the creation of nodes that
should have been filtered out by the subscription's QueryFilter.
8.52 release
8.52 - Released 4/7/2022
- Added testtar.cpp to the tests folder to test the TarFileWriter class.
- Added a assertion-check in the ThreadSetupSystem constructor
to make sure it is being declared in the main thread. - Added a assertion-check in the CompleteSetupSystem destructor to make
sure all declared CompleteSetupSystems are destroyed in LIFO order. - Removed the (useGZip) argument from the ZLibDataIO constructors and
instead created a separate GZLibDataIO subclass to instantiate
when .gz-compatible output is desired. - Updated muscle.dox to suit DOxygen 1.9.3's taste.
- CompleteSetupSystem's initial-memory-usage value is now set only
by the first instance of CompleteSetupSystem. - sizeof(ReflectServer) and sizeof(MessageTransceiverThread) no longer
change depending on whether MUSCLE_ENABLE_SSL is defined or not. - sizeof(MessageIOGateway) and sizeof(MiniPacketTunnelIOGateway) no
longer change depending on whether MUSCLE_ENABLE_ZLIB_ENCODING is
defined or not. - Fixed a bug in ZLibDataIO.cpp that could cause deflated data not to
be fully written out to the child DataIO object in some cases. - Fixed a race condition that could cause Thread::SetThreadPriority()
to occasionally fail with a "no such process" message. - Fixed some #ifdefs in SetupSystem.h and ThreadLocalStorage.h that
assumed that MUSCLE_USE_PTHREADS and MUSCLE_USE_CPLUSPLUS11THREADS
defines were mutually exclusive, when they aren't. - Updated various programs in the tests directory to still compile
(with reduced functionality) even if MUSCLE_ENABLE_ZLIB_ENCODING
isn't specified. - Fixed #include path in Win32FileHandleDataIO.cpp
8.51 release
8.51 - Released 3/15/2022
- Added a SetConsoleLogToStderr(bool) to make it easier to direct
LogTime()'s output to stderr rather than stdout if desired. - Added a "logtostderr" option for HandleStandardDaemonArgs() to
detect and call SetConsoleLogToStderr(true) in response to. - Added support/Archivable.h as an abstract interface to represent
an object that can have SetFromArchive() and SaveToArchive()
called on it. - Added an optional second argument to the ZLibDataIO constructor
that allows it to handle .gz-file-format-compatible data. - Added "zlib" and "gzip" flag-arguments to hexterm.
- Updated TarFileWriter class to be RefCountable
- ZLibDataIO now subclasses DataIO rather than ProxyDataIO, since
it isn't actually seekable or packetizable. - Fixed several deprecation-warnings when compiling under MacOS12.
- QueryFilter now subclasses Archivable.
- Updated PseudoFlattenable methods in the BitChord class to
be static rather than const, so they can be called without
an instance. - Fixed a regression that would cause MessageTransceiverThread to
fail to connect an outgoing session if the session's target
was specified via hostname-string instead of IPAddressAndPort. - Removed the default-value for the template-argument of
ImmutableHashtablePool::DropAllCacheEntriesContainingAnyOfTheseKeys()
since it's unnecessary and ancient (C++03) compilers don't like it.
8.50 release
8.50 - Release 1/31/2022
- Added two-argument versions of the GetAndMoveToFront() and
GetAndMoveToBack() methods in the Hashtable class. - muscleSwap() now calls through to std::swap() when possible.
- Modified various method-calls (e.g. AddNewConnectSession(),
Connect(), ConnectAsync()) that took an IPAddress and a port
as separate arguments to take an IPAdddressAndPort argument instead. - Removed AbstractReflectSession::GetAsyncConnectIP() and
AbstractReflectSession::GetAsyncConnectPort(). Call
AbstractReflectSession::GetAsyncConnectDestination() instead. - Replaced setMargin() with setContentsMargins() in the Qt examples.
- Made the IPAddress single-argument-String constructor explicit.
- Fixed a bug in the iOS implementation of DetectNetworkConfigChangesSession
that could cause crashes during shutdown. - Fixed a bug in Hashtable::HasKeysInCommonWith() that would
cause it to infinitely recurse if the two tables were the same size. - Fixed a bug in Message::ReplaceFlat() that would cause it to
add incorrect data to the Message if the field didn't already exist.