
     _          _                   _
  __| |o ___ __| |__ ___  __ _  ___| |__   ___     distcache
 / _` |_/ __|__   __/ __|/ _` |/ __| '_ \ / , \    Distributed session caching
| (_| | \__ \  | | | (__| (_| | (__| | | |  __/    www.distcache.org
 \__,_|_|___/  |_|  \___|\__,_|\___|_| |_|\___|    distcache.sourceforge.net

-------------------------------------------------------------------------------

                                      ``It is not necessary to change. Survival
                                        is not mandatory.''
                                                         -- W. Edwards Deming


Current version: 0.4.2
----------------------


Changes between 0.4.1 and 0.4.2
-------------------------------

  *) Various backports from the HEAD;
     - acinclude's SSL macros are unused, so remove them.
     - removed some unused bits of bootstrap.sh/unbootstrap.sh/configure.ac.
     - prettified the configure output a bit.
     - Modifications to the RPM spec file;
       - Use the "%configure" RPM macro rather than calling "./configure"
         directly. This ensures that per-platform optimisations and/or
         compilation preferences are honoured.
       - Pre-define $INSTALL_PROGRAM to automatically strip installed
         executables.
       - Include instructions for building redistributable RPMs for various
         CPUs.
     - Remove the unused A-client.pem file from the distribution.
     [Geoff Thorpe]

Changes between 0.4 and 0.4.1
-----------------------------

  *) I discovered a rather annoying bug in the 0.4 release just as I was
     updating apache-2 support. The s/NAL_/SYS_/ changes I made leading up to
     the 0.4 release caused some linker dependencies in our installed libraries
     upon libsys which is *internal-only*. The solution I have put in is that
     libsys/pre.h requires the C file to have declared SYS_LOCAL,
     SYS_GENERATING_EXE, or SYS_GENERATING_LIB. In the instance of
     SYS_GENERATING_LIB, libsys/post.h will not declare any functions
     implemented in libsys. Using this change, the offending dependencies were
     found and have been converted to macros.
     [Geoff Thorpe]

  *) With the release of version 0.4, we have created a branch tag for releasing
     bug-fix releases in the 0.4 series. This tag is BRANCH_0_4.
     [Geoff Thorpe]

Changes between 0.4pre2 and 0.4
-------------------------------

  *) Added the ASCII-art from README.TOOLS to the FAQ so that README.API and
     README.TOOLS can been removed.
     [Geoff Thorpe]

  *) The headers have been re-organised to better guard against the possibility
     of API headers dependending on internal headers. To this end, the libsys
     header has been split in two - one header to include system headers based
     on autoconf findings (pre.h) and one to declare internal functions and
     macros used in the source code (post.h). API headers can depend on pre.h
     but not post.h. Likewise, distcache's internal header (dc_enc.h) has been
     renamed to dc_internal.h. Finally, all the C files have been checked to
     make sure they include headers in the correct order; (a) pre.h, (b) API
     headers, (c) miscellaneous internal headers, then (c) post.h.
     [Geoff Thorpe]

  *) The non-networking stuff in libnal (the daemon/sigpipe/etc wrappers as
     well as the mem and streams debugging cruft) has been separated out into a
     new library, libsys.a, that is not installed but is linked into the
     distcache executables. The names for these macros and functions have also
     been renamed from "nal" or "NAL" prefixes to "sys" and "SYS" respectively.
     Similarly, the source code has been moved out of the libnal/ directory
     into a new directory, libsys/, and the libnal/common.h header has been
     moved to libsys/sys.h.
     [Geoff Thorpe]

  *) Remove unnused stream-hacking functions from libnal, this should have been
     done when libnal first became a separately-installed library. I've also
     defined the NAL_fprintf and NAL_std[in|out|err] symbols directly to their
     stdio.h counterparts - they are only implemented when running debug
     builds, and this is so that we can undefine the raw stdio.h versions to
     verify our code isn't using them directly.
     [Geoff Thorpe]

  *) Force the use of alternative wrappers for strncpy and strdup because
     these may be defined as macros by the system that use memcpy and malloc
     and our debugging code shuts those off. As an added check, our strncpy
     wrapper macro null-terminates all strings unlike the normal version which
     can leave cropped strings without any terminator.
     [Geoff Thorpe]

  *) Fixed the NAL_CONNECTION_is_established() logic. Non-blocking connects are
     now handled and their eventual completion (or failure) will now break
     NAL_SELECTOR_select() operations. NAL_CONNECTION_is_established() and
     NAL_CONNECTION_io() now generate logical results for this scenario.
     [Geoff Thorpe]

  *) Re-organised the "devel/test.sh" script. Output is now cleaner and the
     script is easier to modify for customised mid-hacking tests.
     [Geoff Thorpe]

Changes between 0.4pre1 and 0.4pre2
-----------------------------------

  *) Replaced the "distcache.spec" RPM spec with "mandrake.spec.in". To work on
     non-Mandrake distributions probably requires changes anyway (as per the
     comments in the spec file). The use of autoconf to generate the spec file
     from mandrake.spec.in allows the appropriate version to be substituted
     automatically.
     [Geoff Thorpe]

  *) Forced "VERSION" to be defined by autoconf/automake by hacking inside
     configure.ac, and in such a way that "@VERSION@" is usable by Makefile.am
     files (eg. for pod2man, etc). This previously only worked reliably for the
     particular combination of autotool versions on my system.
     [Geoff Thorpe]

  *) The "targetgroup" replacement trick in the RPM spec was broken, so it has
     been ironed out and header comments have been expanded to note how to
     customise this for non-Mandrake RPM systems.
     [Geoff Thorpe]

  *) Produce conventional static-libraries directly rather than libtool
     archives. This is the easiest way to prevent the installation of "*.la"
     files and as we're already disabling building of shared-libraries
     (AC_DISABLE_SHARED in configure.ac), there's nothing to be gained from
     libtool libraries.
     [Geoff Thorpe]

  *) Allow CVS users to pass settings to bootstrap.sh for use in ./configure if
     it will be automatically run because of PRECONF. These settings can be
     specified by the PREFLAGS environment variable.
     [Geoff Thorpe]

  *) Documentation no longer builds or installs HTML files by default. These
     seem to have grief with cross-links and aren't much use. If someone
     decides to work on that at some point, we can always link it back in - but
     for the mean time the man pages provide the better format.
     [Geoff Thorpe]

  *) Many libnal functions had a return value merely to allow soft failure if a
     required parameter was NULL. This policy has been changed as a hard
     failure is guaranteed in such circumstances anyway and easier to diagnose
     at run-time. To simplify code and remove these unnecessary tests, the soft
     parameter checks have been removed and where appropriate, return types
     converted to void. These changes have propogated back through various
     dependant parts of the code and where appropriate, other functions have
     lost their return type if they are now guaranteed to succeed. Documents
     have also been changed where necessary.
     [Geoff Thorpe]

  *) The type-safe wrappers for malloc/realloc/free and memset/memcpy/memmove,
     as well as their replacement functions (only created during debug builds
     to verify that the raw functions aren't called), have been re-organised
     and consolidated. This results in one less function call each time for the
     malloc stuff in the non-debugging case, and more readable code.
     [Geoff Thorpe]

  *) Removed the unnecessary NAL_BUFFER_read_ptr() function as it is equivalent
     to NAL_BUFFER_data() except the latter (correctly) returns a const
     pointer. This function was apparently written when I was too distracted to
     realise that NAL_BUFFER is a FIFO and the read pointer is invariant. Also,
     remove the NAL_BUFFER_takedata() function and consolidate its slightly
     additional functionality into NAL_BUFFER_read() (namely that a NULL
     pointer can be used to turn the "read" into a "discard").
     [Geoff Thorpe]

  *) Add more API documents;
     - NAL_LISTENER_new.pod (all NAL_LISTENER functions)
     - NAL_SELECTOR_new.pod (all NAL_SELECTOR functions)
     - NAL_BUFFER_new.pod (all NAL_BUFFER functions)
     - NAL_decode_uint32.pod (all NAL_encode_*** and NAL_decode_*** functions)
     - DC_SERVER_new.pod (all DC_SERVER functions)
     [Geoff Thorpe]

Changes between 0.3 and 0.4pre1
-------------------------------

  *) Remove mention of README.API and README.TOOLS from the README, because
     they are not bundled into source distributions. Instead mention the
     documents contained in the doc/ directory.
     [Geoff Thorpe]

  *) More fixes to improve the usefulness of "make dist[-bzip2]";
     - a Makefile for ./devel/ to install useful files,
     - pod files in ./doc/ should be installed too,
     - BUGS note to remind us that README.API and README.TOOLS won't be
       installed and need to migrated to the man pages,
     - install extra files from the top-level directory (ANNOUNCE, BUGS,
       CHANGES, etc),
     - Update the top-level configure.ac to modern automake syntax and
       support for bzip2 tarballs,
     - use EXTRA_DIST in the includes/ directory for headers that aren't
       listed for installation.
     [Geoff Thorpe]

  *) Added a BUGS file, with an initial list of the bugs I'm aware of.
     [Geoff Thorpe]

  *) autoconf/automake-generated sludge files are now left in the top-level
     directory rather than having them in a config directory created and
     destroyed by (un)bootstrap.sh. This is because "make dist" is broken in at
     least one version of the tools and this is the only safe solution I can
     see.
     [Geoff Thorpe]

  *) Add more API documents, now for libnal;
     - NAL_ADDRESS_new.pod (all NAL_ADDRESS functions)
     - NAL_CONNECTION_new.pod (all NAL_CONNECTION functions)
     [Geoff Thorpe]

  *) Rename all libnal allocation functions to NAL_***_new() rather than
     NAL_***_malloc().
     [Geoff Thorpe]

  *) A top-level "include" directory has been created with sub-directories
     matching the format in which we install API headers. All header files that
     need to be used outside their own source directory have been moved into
     this tree, and the automake support has been added so that only those we
     wish to be treated as API will be installed. Eg. libdistcache/dc_enc.h
     needs to be used in a few directories but is not an API header so it has
     moved to include/distcache/ but will not be installed by automake. Ditto
     for libnal/common.h. A consequence of this is that our own source code now
     uses the same include paths as we document for users of the API, which is
     a "Good Thing". Also, we can refine the INCLUDES settings during building
     to be less loose than before. Previously the top-level directory would be
     available as an include path and so would the build directory. The latter
     was only needed to get to the autoconf-generated config/config.h file when
     building outside the source tree, and the former was to allow paths like
     libdistcache/ to be visible. For include paths, the top-level directory is
     now replaced by it include/" sub-directory, and the build directory is now
     replaced by its "config/ sub-directory.
     [Geoff Thorpe]

  *) dc_enc.h has been made an internal-only header and the parts of it we want
     exported have been moved to a new exported header, dc_plug.h. This hides
     DC_MSG and other protocol details from the API, which reduces the hassle
     involved in changing any of them later.
     [Geoff Thorpe]

  *) Start adding API section 2 man pages, currently documenting the
     libdistcache APIs;
     - DC_CTX_new.pod (all DC_CTX functions)
     - DC_PLUG_new.pod (DC_PLUG_[new|free|to_select|io] functions)
     - DC_PLUG_read.pod (all other DC_PLUG functions)
     [Geoff Thorpe]

  *) Fix the libdistcache Makefile to not list a header as a source file and
     to also install dc_enc.h as an exported API header.
     [Geoff Thorpe]

  *) Commit an initial version of a ".spec" file for building distcache RPMs.
     [Geoff Thorpe]

  *) Comment out openssl probes and configuration from our autoconf support so
     that (in-progress) work on RPM scripts and what-not do not automatically
     create package dependencies on openssl.
     [Geoff Thorpe]

  *) Flesh out the existing man pages to be (a little) more complete, and add
     more man pages to supplement them. The man pages available are now;
     - distcache(8)
     - dc_server(1)
     - dc_client(1)
     - dc_snoop(1)
     - dc_test(1)
     [Geoff Thorpe]

  *) Make "-connect" and "-server" aliases in dc_snoop for consistency with the
     syntax used by dc_client.
     [Geoff Thorpe]

  *) Started creating 'pod' documentation. This work is incomple
     [Geoff Thorpe]

  *) Pre-empty failure on HPUX by testing for "-ldld" as needed by OpenSSL's
     DSO code.
     [Geoff Thorpe]

Changes between 0.2 and 0.3
---------------------------

  *) Rename "test_session" to "dc_test" to keep with the naming convention
     for all utilities.
     [Geoff Thorpe]

  *) Tidy up the "bootstrap.sh" script and add support for two built-in gcc
     configurations. If the PRECONF environment variable is set, then the
     bootstrap script will automatically invoke "./configure" with preset
     CFLAGS. The two built-in options are PRECONF=[gcc-RELEASE|gcc-DEBUG].
     [Geoff Thorpe]

  *) Add two switches to test_session to allow controlling the size of session
     data when generating sample sessions manually. This doesn't apply in the
     OpenSSL case, but I have disabled the use of OpenSSL in test_session too
     as it wasn't terribly useful and adds complexity to the build system.
     [Geoff Thorpe]

  *) Fix a "flushing" bug in libdistcache that would occasionally not fully
     advance the state-machine of a "plug" in either the read or write
     direction.  This occurred when a connection's read or write buffer
     contained data for more than one fragment of message - sometimes a
     subsequent fragment would not be pulled (or pushed) through, leading to
     occasional hangs in a select() waiting for traffic that has already been
     received. This should finally mark the end of the "works for a while then
     hangs" problems we were seeing.
     [Geoff Thorpe]

  *) Add a helper program, "dc_snoop", to act as a transparent proxy. When a
     client connects, a corresponding peer connection is set up to the
     configured back-end server and data is transparently proxied back and
     forth - meanwhile it is analysed and various information can be displayed
     to the console.
     [Geoff Thorpe]

  *) Correct some comments, and make sure *all* code agrees on a fragmentation
     size of 2048 for messages broken into fragments. This affects binary
     compatibility with 0.2, but 0.2 was (in some cases) broken in this respect
     anyway. In any case, the protocol version is bumped to ensure subsequent
     versions don't try to talk to older versions.
     [Geoff Thorpe]

  *) A variety of changes to libnal
     - get rid of unused (and horrible) NAL_***_move() functions,
     - change a miniscule helper function to a more readable macro,
     - re-organise the helper macros into their own section of code,
     - Consolidate the malloc/free code with the init/finish code as
       malloc/free is the only mechanism declared in the libnal API,
     - improve parameter checking,
     - improve some logic such that a structure's elements are only
       changed if success of the function is guaranteed - makes error-handling
       easier,
     - regard accepted connections as automatically "established" even
       if they are non-blocking.
     [Geoff Thorpe]

  *) Avoid more "statement will never be executed" and signed/unsigned
     warnings. Use "do { ... } while(0)" bracings in the libnal typesafe
     macros.
     [Geoff Thorpe]

  *) Fixed two nasty bugs caused by uninitialised structure elements in
     sessclient. Thanks to valgrind.
     [Geoff Thorpe]

  *) Make some macros in libnal/common.h more robust against semi-colons, or
     expressions being used as parameters. Also, clarify and simplify some
     timeval handling in libnal/sys.c.
     [Geoff Thorpe]

  *) Fixed some "cached_idx" nastiness found in libdistcacheserver where -1,
     which was used to indicate "nothing cached", was not being checked and
     instead populated into an unsigned integer as a valid index. Also fixed
     some weird-looking code found during the bug-hunt.
     [Geoff Thorpe]

  *) Fix the "ISO C89 compiler" warnings about string constants longer than 509
     characters by re-declaring them as arrays of strings. This means the
     utility programs display their usage messages by displaying each string in
     the array separated by newlines.
     [Geoff Thorpe]

  *) Remove unexecutable code, and correct some more signed/unsigned
     mismatches.
     [Geoff Thorpe]

  *) Indent #error directives (so "traditional" C pre-compilers ignore them)
     and unindent any #define directives (so the same pre-compilers don't
     ignore them).
     [Geoff Thorpe]

  *) Some signed/unsigned mismatches were causing integer variables, that use
     -1 as a special case, to be munged and not treated as negative. This was
     causing some array smashing and other weirdness.
     [Geoff Thorpe]

  *) Fixed include paths in automake so that any build directory, different to
     the source-tree itself, can be used by running;
         /path/to/distcache/configure --srcdir=/path/to/distcache ...
     [Joe Orton <jorton@redhat.com>]

  *) If the build system contains pkg-config, use that to establish compiler
     and linker flags for building against OpenSSL.
     [Joe Orton <jorton@redhat.com>]

  *) Re-order some autoconf checks, eg. check library/linkage first so that
     additional linker flags (such as "-lnsl -lsocket" on Solaris) are
     available before we check for specific functions.
     [Steve Robb]

  *) Extend NAL_daemon() for platforms that don't provide the daemon(3)
     function (eg. Solaris) by implementing our own fallback version.
     [John Milton <john.milton@fxfn.com> and Steve Robb]

  *) Upgrade the mod_ssl (apache 1.3.*) support to mod_ssl-2.8.12
     [Steve Robb]

  *) Change the name of the executables "sclient" and "sserver" to "dc_client"
     and "dc_server" to avoid name-clashes with the Kerberos distribution.
     [John Milton <john.milton@fxfn.com> and Geoff Thorpe]

  *) Add a demo client certificate (taken from my "tunala" demo in OpenSSL) for
     use in "test_session" when generating sample sessions containing peer-
     certificates.
     [Geoff Thorpe]

Changes between 0.1-seed and 0.2
--------------------------------

  *) Altered the binary protocol used by distcache to begin each message with a
     32-bit protocol level. The top 16-bit word of this is a "protocol value"
     which must be identical for peers to interoperate (though a server with a
     higher value could respond to the first request by adopting the peer's
     protocol). The lower 16-bit word is a "patch level" which allows the more
     recent of two peers to decide if it should accept communications or not
     with the peer (and work around older bugs if necessary).
     [Geoff Thorpe]

  *) Added DISTCACHE_CLIENT_API and DISTCACHE_CLIENT_BINARY version defines to
     dc_client.h so that apache/mod_ssl plugins can run sanity checks on the
     version of distcache.
     [Geoff Thorpe]

  *) Allow building without OpenSSL support (only affects test_session which
     can generate garbage sessions to test with rather than OpenSSL-compatible
     ones).
     [Geoff Thorpe, Steve Robb]

  *) Add "-pidfile" and "-daemon" switches to the 'sserver' utility.
     [Geoff Thorpe]

  *) Added a self-test script to test sserver and sclient with test_session.
     [Geoff Thorpe]

  *) Removed various things from 0.1-seed that aren't relevant;
     - IN_MAKEDEPEND hacks no longer needed as autoconf/automake handle
       dependencies.
     - wrapper functions removed for unneeded stuff, fork(), waitpid(), etc.
     - NAL_SELECTOR_create() removed too.
     - NAL types are always dynamic now, so init() functions aren't needed to
       initialise static versions.
     - Get rid of some unnecessary types and use just DC_ERR where possible
       (this altered the protocol slightly).
     [Geoff Thorpe]

  *) Use the autoconf-generated config.h to control #includes.
     [Geoff Thorpe]

  *) Add the first part of autoconf/automake/libtool support to distcache
     including numerous followup tweaks.
     [Steve Robb]

