2005-05-24 03:46  sean

	* configure.ac (RELEASE_1_3): Stamp 1.3.0 beta9

2005-05-24 03:30  sean

	* include/memcache.h.in, src/memcache.c (RELEASE_1_3): Fix those
	  god damn, mother fucking protocol errors.  Pardon my french.
	  Problem was due to a partial read that was looking ahead too far
	  in its buffer.  Ie, the parser was looking at "\r" and peaking
	  ahead to see if it was "\r\n", and was throwing a kanipshit if it
	  couldn't find it's newline.

	  There were a few other oddities that I've addressed.	I've
	  extensively tested this now with a default buffer size of one
	  byte and have run tests with that byte side, and a few others,
	  all the way up to 16K and feel rather confident that this issue
	  has been addressed.  Yay!

2005-05-24 03:21  sean

	* test/long_val/long_val.c (RELEASE_1_3): Fix up my long_val test
	  so that it uses:

		  sizeof("key")

	  instead of:

		  char *key = "key";
		  sizeof(key);

2005-05-22 10:54  sean

	* configure.ac (RELEASE_1_3): Test for variadic macro support.
	  Conditionalize protocol debugging on the presence of variadic
	  macros.

2005-05-22 09:51  sean

	* Makefile.am (RELEASE_1_3): Add a quick disthook that removes the
	  regen file from public tarballs.

2005-05-20 20:59  sean

	* test/buffer_recycle/buffer_recycle.c (RELEASE_1_3): Enable some
	  debugging output by removing the default error masks.

2005-05-20 20:51  sean

	* configure.ac (RELEASE_1_3): Remove -Wdisabled-optimization from
	  CFLAGS.  Had this in there twice and only removed one of the
	  flags.  *blush*

2005-05-20 20:51  sean

	* .cvsignore (RELEASE_1_3): Ignore distfiles

2005-05-20 20:47  sean

	* configure.ac (RELEASE_1_3): Test to see if $CC supports -std=c99,
	  -Wpacked, and -Wdisabled-optimization.  This should make life
	  easier for people still using GCC < 2.95.X.

2005-05-20 20:06  sean

	* src/memcache.c (RELEASE_1_3): Change the timestamps in error
	  messages to be fixed width (pad with zeros).

	  Apply the same fix provided by McCaskey to all memchr(3) calls.

2005-05-20 19:51  sean

	* test/buffer_recycle/.cvsignore (RELEASE_1_3): Add a quick
	  .cvsignore for the buffer recycle test.

2005-05-20 19:32  sean

	* src/memcache.c (RELEASE_1_3): Handle the case where a signal is
	  delivered and interrupts a select(2) call.

2005-05-20 18:03  sean

	* Makefile.am, configure.ac, test/Makefile.am,
	  test/buffer_recycle/Makefile.am,
	  test/buffer_recycle/buffer_recycle.c (RELEASE_1_3): Add a problem
	  test.

	  Obtained from: Cimarron Taylor, FilmLoop

2005-05-20 17:43  sean

	* configure.ac (RELEASE_1_3): Roll 1.3.0.beta8.  Many critical
	  fixes... still not flawless... there's one more that I'm still
	  hunting before 1.3.0 rc1 gets stamped.

2005-05-20 17:33  sean

	* test/long_val/long_val.c (RELEASE_1_3): Introduce a small
	  presentation cleanup that lets the user know if the server
	  couldn't find the given key.

2005-05-20 16:48  sean

	* regen (RELEASE_1_3): Include a small test for acinclude.m4 as a
	  reminder to myself.  Also force the copy'ing of various bits.
	  This frequently stomps on INSTALL, but I can deal with that for
	  now.

2005-05-20 16:45  sean

	* test/benchmark/benchmark.c (RELEASE_1_3): Nuke trailing
	  whitespace.

2005-05-20 16:44  sean

	* Makefile.am (RELEASE_1_3): Include a server on port 11214 in the
	  list of servers to start.

2005-05-20 16:32  sean

	* include/memcache.h.in, src/memcache.c (RELEASE_1_3): Remove the
	  const modifier for the memcache_ctxt argument for a handful of
	  mcm_server_add*() functions.

	  Cast various timestamps in the default error handler to int.	The
	  lack of standard time representation in unix is starting to
	  really piss me off.

	  Add more debugging code than one should ever have to wade through
	  or view.

2005-05-20 12:06  sean

	* include/memcache.h.in, src/memcache.c (RELEASE_1_3): Introduce a
	  timeout error code.

	  Spell UNKNWON as UNKNOWN.

	  Print out the severity if it's unkown and hide behind
	  DEBUG_MC_PROTO.

	  Add a timestamp to error messages.

	  Add a ton of debugging info to mcm_server_readable() and
	  mcm_server_writable().

2005-05-20 09:14  sean

	* configure.ac, test/Makefile.am, test/long_val/.cvsignore,
	  test/long_val/Makefile.am, test/long_val/long_val.c
	  (RELEASE_1_3): Add a test that set/get's values of increasing
	  size and verifies the contents of the value.

2005-05-20 07:08  sean

	* include/memcache.h.in, src/memcache.c (RELEASE_1_3): Ditch the
	  concept of a select(2) timeout.  select(2) doesn't seem to be
	  working correctly at the moment when a fd is marked as
	  non-blocking, then passed to connect(2).  I should be able to
	  select(2) on the fd for when its writable, but it's always timing
	  out.	As such, keep the file descriptor in blocking mode until
	  we've connect(2)'ed, then switch over to using a non-blocking fd.
	  What a pain in the ass.  kqueue(2) anyone?  Coming soon...

2005-05-20 01:38  sean

	* include/memcache.h.in (RELEASE_1_3): Once upon a branch, far, far
	  away, I did some repo surgery and moved a header around.  Now
	  that I'm back on a branch-tag that depends on this file pre-move,
	  make a copy of the file.  This may cause me headaches later, but,
	  for now it gets me rolling again.

2005-05-20 01:30  sean

	* regen (RELEASE_1_3): MFC: Update regen to contain updated auto*
	  bits after a fink update on my laptop.

2005-05-20 01:17  sean

	* src/memcache.c (RELEASE_1_3): Fix a small bug found by John
	  McCaskey wherein memcache(3) would block improperly.

2005-05-02 03:02  sean

	* test/benchmark/benchmark.c: Fix for non-c99 compilers.

2005-05-02 02:58  sean

	* Makefile.am, src/memcache.c: Cope with stone-age compilers.

2005-05-02 02:48  sean

	* configure.ac: Stamp 1.3.0.beta7.  This isn't a flawless version,
	  but it's the first version post-autofuck that I'd be
	  semi-comfortable pushing out.

	  The two oustanding issues are:

		  There is an outstanding issue when using benchmark in
	  that
		  after a prolonged period of time, the client begins to
		  ping-pong between select(2) and read(2).

		  There's also an oustanding issue where it looks as though
		  select(2) with a NULL timeout doesn't seem to ever
	  return.

	  Regardless, the performance times are down to nominal levels
	  again.

	  Key size:	  50 Num tests:      1000 Test	  Ops per second
	  Total Time	  Time per Request set	   8651.117724	   0.115592
		 0.000116 get	  8695.576560	  0.115001	  0.000115
	  add	  8441.881864	  0.118457	  0.000118 delete
	  9559.315553	  0.104610	  0.000105

2005-05-02 02:43  sean

	* src/memcache.c: *) Replace -DPEDANTIC with
	  --enable-mc-proto-debug's DEBUG_MC_PROTO

	  *) Break the API by changing the args of
	  mc[m]?_server_disconnect().  I may	revisit this, but removing
	  struct memcache from the arg list is the    right thing to do
	  since none of its downstream consumers used struct	memcache.

	  *) Add a few internal functions, mcm_server_(readable|writable)
	  to begin    to centralize handling of file-descriptor related
	  activities.  The    various calls to select(2) floating around
	  were giving me the creaps.

	  *) Took the ugly-stick and beat the hell out of my code by adding
	  scores of    DEBUG_MC_PROTO bits.

	  *) Centralize calls to close(2) in mcm_server_disconnect().

2005-05-02 02:37  sean

	* Makefile.am: The test target depends on the check target.

2005-05-01 23:00  sean

	* test/benchmark/benchmark.c: A few fixups for benchmark.c now that
	  the key is a char* instead of a char[].  sizeof() seems to think
	  the variable is of a different size.	Imagine that.  *grin*

2005-05-01 22:59  sean

	* Makefile.am, configure.ac: Automatically build a ChangeLog and
	  include it in distributions.

	  Reintroduce the 'reset' target which resets test versions of
	  memcached.

	  Change the automake(1) target from 'memcache' to 'libmemcache'
	  for the sake of building distributions.

	  Add a test for memcached(8).

2005-05-01 22:20  sean

	* Makefile.am: Fix small nit in auto* build process.  Don't use
	  test/* as a subdir, just list test.

2005-05-01 22:19  sean

	* regen: In the least elegant way possible, enable building of the
	  autofuck bits on my powerbook.

2005-05-01 22:17  sean

	* configure.ac: Fix small nit in struct iovec detection on systems
	  that don't include prerequisites.

2005-05-01 21:30  sean

	* Makefile.am, test/Makefile.am: Add a few targets to simplify
	  running of tests.

2005-05-01 20:25  sean

	* test/: benchmark/benchmark.c, regress/regress.c: Fix up a few
	  warnings with various test programs.

2005-05-01 20:23  sean

	* configure.ac: Introduce all of the various auto* changes
	  necessary to suppor the previous commit message.

	  Add --enable-debug to turn on debugging CFLAGS.

	  Add --enable-default-buf-size to configure the default
	  buffer/read size buffer.

	  Add --enable-hash-type which lets the client side hash type be
	  changed easily at compile time.  Valid values are "crc32", "elf",
	  or "perl"

	  Add --enable-mc-iovec to enable/disable the use of memcache's
	  internal struct iovec.  Autofuck should automatically detect the
	  need/use of this, but, it should be automatically enabled on
	  nearly all POSIX systems automatically.

	  Add --enable-mc-proto-debug to the mix.  It doesn't do anything
	  at the moment, but will in a matter of hours.  Joy.

	  Add --enable-profiling turns on profiling CFLAGS.

2005-05-01 20:12  sean

	* src/memcache.c: Replace static definitions of version numbers
	  with autofuck macro's.  This should reduce file churn slightly.

	  Make use of some auto* magic and replace various function
	  obfuscation bits with some md5(1) magic... or other evilness in
	  the absense of md5(1).

	  Nuke various static compilation #define's in favor of some goo
	  that's going to be made evident in the following commit to
	  configure.ac.

	  Introduce a new integer into struct memcache_ctxt to replace the
	  use of the global errno(2) value.  When an atomic
	  increment/decrement command is executed, the return value will be
	  set to zero and ctxt->errnum will be set to ENOENT.

2005-05-01 19:44  sean

	* INSTALL: Update the installation instructions to reflect the use
	  of autofuck instead of pmk(1).

2005-05-01 19:43  sean

	* .cvsignore, include/.cvsignore: Update the list of files to
	  ignore

2005-05-01 16:13  sean

	* .cvsignore, Makefile.am, configure.ac, regen, doc/.cvsignore,
	  doc/Makefile.am, include/.cvsignore, include/Makefile.am,
	  m4/.cvsignore, m4/Makefile.am, src/.cvsignore, src/Makefile.am,
	  src/memcache.c, test/.cvsignore, test/Makefile.am,
	  test/benchmark/.cvsignore, test/benchmark/Makefile.am,
	  test/benchmark/benchmark.c, test/regress/.cvsignore,
	  test/regress/Makefile.am: First pass at switching from pmk(1) to
	  autofuck and friends.

2005-04-30 15:15  sean

	* test/regress/regress.c: In one case, use 'localhost' instead of
	  '127.0.0.1'

2005-04-30 15:14  sean

	* test/benchmark/benchmark.c: Add a benchmark program used to test
	  requests per second.	The server list is still hard-coded,
	  however, but it's a useful start for debugging performance calls.
	  I need to find a performance analysis program that is useful for
	  IO intensive programs, other than gprof(1).  Until then, this is
	  helpful.

2005-04-30 13:17  sean

	* src/memcache.c: Make memcache(3) warning free.

2005-04-29 18:07  sean

	* src/memcache.c: Ah ha!  Strangeness in latency land.	Funny
	  people are these... people with green eyes, whirring squabble
	  sounds that look like funny blinking machines with wires... evil
	  are they.  But that wasn't the problem.  If the buffer size was
	  too small, it would result in a tiny latency from a second
	  read(2) call as well as potentially an additional malloc(3) which
	  seems to have irritated the overly hyper performance sensitive
	  folk.  *grin*

	  Submitted by:   Adam Michaels

2005-04-22 12:41  sean

	* src/memcache.c: Move the select(2) call to after the connect(2).
	  Dumb, dumb, dumb, dumb.  errno = ENEEDSLEEP;

2005-04-21 16:29  sean

	* src/memcache.c: Use non-blocking IO + select(2) - if it's
	  available - to implement a connection timeout.
	  setsockopt(SO_RCVLOWAT) doesn't handle this.

2005-04-21 16:03  sean

	* src/memcache.c: Fix a bug that would pop up if no servers were
	  available to connect to.

2005-04-21 15:28  sean

	* src/memcache.c: When incrementing/decrementing a key, if the key
	  is not found, return 0 *and* set errno to ENOENT that way
	  decrementing from 1 to 0 can be done successfully and clients can
	  detect success from failure.

	  On machines that resolve a hostname to an IPv6 address, but the
	  host doesn't support IPv6, silently continue.  It is common for
	  machines to have an entry in hosts(5) for localhost that resolves
	  to an IPv4 and IPv6 address.	On machines configured like this,
	  people can now resume using 'localhost' instead of the IPv4
	  address 127.0.0.1.

	  Set a receive timeout to limit times for connect(2) failures.

2005-04-19 17:26  sean

	* src/memcache.c: If we're performing a multi-get, short-circuit
	  the key delegation if there is only one server and execute the
	  get request immediately.

2005-04-19 17:03  sean

	* src/memcache.c: Fix multi-get's internal flags.  While the data
	  was being returned correctly, the internal flags weren't being
	  set.	This had the effect of causing mc[m]?_res_found() and other
	  like functions to fail or return incorrect values.

	  Now (after a bit of testing), push beta4 out the door.

2005-04-19 16:23  sean

	* src/memcache.c: Performance tweak.  Don't hash a value that's
	  already been hashed.

2005-04-19 13:47  sean

	* src/memcache.c: Don't copy _flags when doing a multi-get.
	  Instead, zero the flags out.

2005-04-19 13:46  sean

	* test/regress/regress.c: Fix a memory leak that was picked up in
	  valgrind.

2005-04-19 09:30  sean

	* src/memcache.c: Add a trace debug message that executes at the
	  INFO level.  Handy for debugging.

2005-04-19 09:04  sean

	* src/memcache.c: mcm_get(3) now queries the correct servers in
	  multi-get requests.  memcache(3) now performs correctly with
	  multi-get requests.  Previously multi-get would only work on
	  single servers.  Single-get requests always worked, however.

2005-04-18 23:11  sean

	* src/memcache.c: Fix error handling... I'm not adding '...'
	  support for memcache(3)'s error handling for a while, I just want
	  to get 1.3 out the door.  Almost there...

2005-04-18 23:08  sean

	* src/memcache.c: Do a better job of checking the return of
	  strtol(3) in the event that the data being returned is zero.
	  This should quell the remaining strtol(3) errors that folks have
	  seen.  Entirely my fault: I should've done a better job of
	  checking the return values earlier or not used endptr at all.

	  In mcm_server_activate_all(3), only call mcm_server_activate(3)
	  on servers that are down.  All other server conditions are
	  ignored.  Callers can still explicitly call
	  mcm_server_activate(3) on their own, though I can't promise that
	  there won't be an info message generated due to incorrect library
	  use.

2005-04-18 17:38  sean

	* src/memcache.c: Install a default error function handler by
	  default.

2005-04-18 13:11  sean

	* src/memcache.c: Only call the error handler if an error handler
	  has been set.

2005-04-14 23:12  sean

	* src/memcache.c: Ensure that all strings returned by memcache(3)
	  are null-terminated.

	  Pointed out by: cimarron@taylors.org

2005-03-29 12:10  sean

	* src/memcache.c: I'd give my left nut to have time_t defined as
	  the same width on all systems.  Cast accordingly.  *kicks OS-X
	  for not being fully compliant with FreeBSD*

2005-03-28 12:35  sean

	* src/memcache.c: Promote a handful of warnings to errors (library
	  calls).

	  Promote the test message to a warning that way people will see it
	  by default if they invoke the test handler.

	  Ignore NOTICE and INFO messages by default.

	  Push out 1.3.0.beta2

2005-03-28 12:19  sean

	* src/memcache.c: Ignore all INFO level messages by default.

2005-03-28 06:45  sean

	* src/memcache.c: *) Drop const from a bunch of functions that were
	  passed memcache_ctxt.     Now using the memcache_ctxt for passing
	  around a backup copy of the	  last command send to the server.
	  This is necessary in the event that a     server dies and the
	  command needs to be reissued to another server.

	  *) Change the magic hash value from 42 to 0.	My engineering
	  mindset finally    over took my sense of humor and desire to
	  plant eggs (maybe this is just    a counter-reaction to easter,
	  who knows).

	  *) Consolodate looking up of valid servers and connecting to
	  servers in	mcm_server_connect_next_avail(), which will exhaust
	  a server list    attempting to find a valid memcache server.

	  *) If read(2) or writev(2) fail when communicating with a server,
	     memcache(3) will no reconnect to the same server, or find
	  another server    automatically.

	  *) Change a bunch of MCM_(ERR|WARN)() macros to their X
	  counterpart since    there is no errno attached to the warning.

2005-03-27 15:24  sean

	* src/memcache.c: Cleanup handling of read(2) in
	  mcm_retrieve_data() such that it will now reconnect if necessary.

2005-03-27 15:00  sean

	* src/memcache.c: When read(2)'ing data from the client:

		  *) handle EINVAL by reconnecting (though this shouldn't
	  ever happen)
		  *) And throw a few asserts for EBADF, EFAULT, as well as
	  for the
		     default case

2005-03-26 15:52  sean

	* src/memcache.c: Ensure that we're using non-blocking IO when we
	  start mcm_retrieve_data().

	  Put place holders for more grainular error handling for return
	  codes from writev(2) and read(2).  More on that later today,
	  hopefully.

2005-03-26 15:44  sean

	* src/memcache.c: Add a new error flag, MCM_ERR_MC_RECONN.  It's an
	  INFO level notice that gets thrown when a server connection is
	  re-established.

2005-03-26 15:40  sean

	* src/memcache.c: Move calls of mcm_server_block() into the
	  routines that are actually doing the IO (ie: mcm_get_line() and
	  mcm_server_send_cmd()).

	  Reset errno after we return from executing the error handler.

	  Nuke #warning's.  They were just too obnoxious and I'd rather
	  have only two lines of warnings instead of six from gcc about
	  #warning.

	  Stop calling MCM_CSTRLEN() on pointers.  sizeof() is fickle and
	  it doesn't dereference a void * to figure out the size of a
	  string.  Sucks, but better than having the application hang
	  because it thinks "stats\r\n" is the same length as a pointer,
	  and not 8 bytes long.

2005-03-26 15:01  sean

	* src/memcache.c: Revamp the private function mcm_err() to include
	  a suggested error level.

	  Consolidate all writev(2) calls into mcm_server_send_cmd().

	  Handle ECONNRESET in mcm_get_line().	If a client has a long
	  running connection to a memcache server and the memcache server
	  resets, the client no longer deactivates the server in this case.
	   Instead, the client resends the last command issued, and
	  attempts to read(2) the response.  If it fails a second time,
	  then it deactivates the server.

	  Add a few #warning bits to tell users to ignore the warnings.
	  Mind you, these #warning snippets cause more output than the two
	  remaining warnings, but until I figure out a way to tell gcc(1)
	  to fuck off and die, I'll leave these in here for now.

	  Convert mcm_server_stats() to using mcm_server_send_cmd().

2005-03-26 11:48  sean

	* src/memcache.c: Add mc[m]?_server_add5() which is the same as
	  mcm_server_add4() except that it takes an optional length
	  argument.

	  Add mc[m]?_strnchr() which behaves the same as strchr(3) except
	  that it also takes a length arg.

	  Implement mc[m]?_server_add4() in terms of mcm_server_add5().

2005-03-26 10:55  sean

	* src/memcache.c: Make mcm_err_func() be consistent with what I'm
	  telling clients to use: return int32_t.

2005-03-26 10:44  sean

	* src/memcache.c: Futz with the function signatures and
	  initialization routines for error handlers.

2005-03-26 10:28  sean

	* src/memcache.c: Correct an interface oversight and obfuscate/hide
	  the interface to error handlers behind some predefined macros,
	  similar to what I did for the call back interface.

2005-03-26 10:11  sean

	* src/memcache.c: Add mc[m]?_err_filter_(add|del|get|test)().  This
	  lets clients ignore error messages from various error levels.
	  I'm pondering adding a second filter for error codes, but haven't
	  done so yet.

2005-03-25 19:28  sean

	* src/memcache.c: Add mcErrSetup(), mcErrGet(), and
	  mcErrSetupCtxt().  Missing those was something of a glaring
	  oversight for the non-context users.

2005-03-25 19:10  sean

	* src/memcache.c: Replace a few left over abort(3) calls with their
	  appropriate MCM_ERR*(*) counterpart.

2005-03-25 18:59  sean

	* src/memcache.c: Apologizes in advance for the large commit.

	  *) Introduce mc_const.  It lets me conditionally const'ify
	  certain  struct headers without undef'ing every const
	  declaration.	Useful for  making sure client applications do the
	  right thing.

	  *) Bump the version number to 1.3.0.	I reserve the right to
	  change  anything before an official announcement, however.

	  *) Define a few severity levels for error logging: NONE, INFO,
	  NOTICE,  WARN, ERR, and FATAL.  They're prefixed with either
	  MCM_ERR_LVL_ or  MC_ERR_LVL_, depending on your application's
	  coding preference.

	  *) Add a host of error codes, 22 to be specific.  See memcache.h
	  for  the actual values.

	  *) Add struct memcache_err_ctxt.  This context is passed to error
	   handlers when an error occurs.  See memcache.h for details.

	  *) Add a new member to struct memcache_ctxt, an mcErrFunc.  There
	  is  only one per context, but it is thread safe and lets callers
	  catch  any error and act accordingly.

	  *) Add mc[m]?_err_test() which tests the registered error
	  handler.

	  *) Added an interesting and potentially harmful feature:
	  memcache(3)'s  very own struct iovec.  I did this to quell the
	  various warnings when  assigning const char *'s to iovec.iov_base
	  (nearly always defined as  either void * or char *, not const
	  _whatever_).	I have a runtime  test in place, but it's not a
	  compile time test.  For now, I've  enabled it by default, but it
	  can be easily turned off.

	  *) Hide various personal extensions behind #ifdef's

	  *) Add a handful of MCM_ERR*() and MCM_WARN*() macros to aid in
	  invoking an error response.

	  *) Invoke user error handling routines via mcm_err().  It bundles
	  up  all of the relevant information, creates struct
	  memcache_err_ctxt,  and passes it to the function.

	  *) Add a default error handler.

	  *) Replace all warn(), warnx(), err(), errx(), and abort() calls
	  with	their respective macro that uses the error handler.

2005-03-21 20:56  sean

	* src/memcache.c: size_t's format should be %lu, not %u.  Why can't
	  everyone use compilers that support the %z format modifier?

2005-03-21 20:42  sean

	* src/memcache.c: Fix incorrect handling of buffers often caused by
	  slow network connections (often seen on buggy linux machines or
	  OS-X which doesn't have a functioning TCP_NOPUSH).

	  Submitted by:   Richard Cameron <camster@citeulike.org>

2005-03-21 20:34  sean

	* src/memcache.c: Fix a memory leak and segfault resulting from my
	  moving of buffers to be per-server specific struct from the
	  per-memcache struct.

	  Patch by:	  John McCaskey

2005-03-21 20:17  sean

	* INSTALL: Add a bit of errata for gcc 2.X.

2005-03-21 20:06  sean

	* test/regress/regress.c: Add note pointing out for developers to
	  use strlen() instead of MCM_CSTRLEN().

	  Prompted by gripe from: Andy Powell

2005-01-23 23:22  sean

	* INSTALL: /libmemcache(3)/memcache(3)/

2005-01-23 23:21  sean

	* src/memcache.c: I think the warning message says it best:

	  #warning "Working around busted-ass Linux header include
	  problems: use FreeBSD instead" #warning "http://www.FreeBSD.org/
	  - you won't regret it"

2005-01-20 10:12  sean

	* COPYING: Add the license used for this software (MIT License).

2005-01-20 00:54  sean

	* src/memcache.c: Fucking Linux/GPL/gcc, why can't it just curl up
	  and die?  Change %zu and %hu to just %u.  This adds a warning
	  that *should* be reasonably harmless.

		  memcache.c:2192: warning: unsigned int format, size_t arg
	  (arg 4)

2005-01-20 00:33  sean

	* test/regress/regress.c: Plug small memory leak in regression
	  tests.

	  Pointed out by: John McCaskey

2005-01-20 00:23  sean

	* src/memcache.c: *) Add flag to note the need to free a key when
	  it's passed and strdup()'ed	 instead of passed by reference
	  (ie, mcm_req_add() vs mcm_req_add_ref()).

	  *) Use mcm_req_add_ref() in mcm_aget() and mcm_arefresh() instead
	     of mcm_req_add(): no sense in mcmStrdup()'ing a string that we
	  know isn't	going to change.  Unfortunately this introduces a
	  warning, but the code    is correct because GCC can't see the
	  logic and use of the flag in struct	 memcache_res's _flags
	  member.

2005-01-11 03:16  sean

	* src/memcache.c: Move various buffer orriented struct memcache
	  members to struct memcache_server in preparation for support of
	  the non-blocking IO scatter/gather multi-get scheme described on
	  the memcached@ mailing list.	This transion deferrs
	  initialization of the buffer from creation of struct memcache, to
	  the creation of struct memcache_server *and* increases the memory
	  overhead to be: buffer size * number of servers.  The default
	  buffer is still 2KB.

2005-01-10 13:34  sean

	* src/: crc32_table.h, memcache.c: For the longest time, this
	  gnarly crc32 prebuilt table has been a rather large eye sore.
	  Fix by moving said table into it's own header file and include
	  accordingly.

	  With crc32 table (and it's hex values gone), continue my
	  aspell(1) sweep and tidy up some type-o's.  This is what I get
	  for either having brain-o's, or for typing with a largish bandage
	  on my index finger.  I'll be quite happy when I'm no longer
	  EDOGBYTE errors (pun intended).  *sigh*

2005-01-10 02:31  sean

	* src/memcache.c: Peremptev spel chek run,

2005-01-09 01:03  sean

	* src/memcache.c: Don't hash to find the remote server when there
	  is only one live server.  This should shave a few CPU cycles for
	  folks who only have one server up.

	  Add a new function, mc[m]?_req_add_ref().  mc[m]?_req_add_ref()
	  behaves identically to the way mc[m]?_req_add() used to.
	  mc[m]?_req_add() now mc[m]?_strdup()'s the key to be safe.
	  mc[m]_req_add_ref() uses a reference instead of a copy.  This was
	  a performance/safety issue that I felt was best to err on the
	  safe side unless someone goes out of their way to understand the
	  dangers/benefits of the _ref() version.

2005-01-04 13:35  sean

	* test/regress/regress.c: Copyright bump: add 2005

2005-01-04 12:44  sean

	* test/regress/regress.c: Use three servers again and make use of
	  mc_server_add4() to make this possible again.

2005-01-04 12:43  sean

	* src/memcache.c: Add mc[m]?_server_add4().  Takes a host argument
	  in the form of: "127.0.0.1:11211".  Should be useful for a number
	  of different applications, not the least of which is config
	  files.

	  Add mc[m]?_strndup().  Copies at most len bytes and adds a '\0'
	  padding character.  Handy.  Wish this was a part of the standard
	  C string lib.  mcm_strdup() is now implemented in terms of
	  mcm_strndup().

	  Change mc[m]?_str[n]?dup() to use the atomic malloc instead of
	  the normal malloc.  Just an optimization/correctness thing for
	  GC'ed environments.

	  It's starting to smell alot like release time...

2005-01-04 11:48  sean

	* src/memcache.c: Add a few version functions:

	  mc[m]?_reldate()	  Returns a numeric version of the date the
	  library			version was released: 20050104

	  mc[m]?_vernum()	  Returns a numeric version of the library:
	  010200

	  mc[m]?_version()	  Returns a string version: "1.2.0"

	  Add a few matching #define's too:

		  MEMCACHE_VER
		  MEMCACHE_VERNUM
		  MEMCACHE_RELDATE

	  in the event that someone has cpp(1) skills.

2005-01-03 16:41  sean

	* src/memcache.c: Expose mc[m]?_server_new() to the public.
	  Another useful function for OOP language wrappers.  Change the
	  default inits from memcache_server_new() to
	  memcache_server_add3().  This may bite a few people who want a
	  default timeout that's non-zero for all servers, but one.  This
	  should be rare though.

2005-01-03 16:15  sean

	* src/memcache.c: Expose mc[m]?_strdup() as public APIs since it
	  seems as though non-braindamaged versions exist with regards to
	  memory context sensitive APIs (ie, ruby).

2005-01-03 14:27  sean

	* src/memcache.c: Add a new way of adding a server via:

	  int mcm_server_add3(const struct memcache_ctxt *ctxt, struct
	  memcache *mc, struct memcache_server *ms); int
	  mc_server_add3(struct memcache *mc, struct memcache_server *ms);

	  Useful when writing OOP language wrappers.  mc[m]?_server_add2()
	  is implemented in terms of mc[m]?_server_add3().

2004-12-29 11:58  sean

	* src/memcache.c: Make mc[m]?_server_free() public.  No one should
	  use this, but it's handy for my ruby bindings, so someone else
	  may find a use/need for this as well.

2004-12-29 10:18  sean

	* src/memcache.c: Further my quest to piss off as many users as
	  possibly by changing the API for various memory context functions
	  by removing the need for a strdup(3)-like function.  This was
	  stupid and I should've provided a static version from day one.
	  Correct this oversight.  I wonder what other API changes I should
	  make before the 1.2.0 release to get this over with as soon as
	  possible.

2004-12-24 18:34  sean

	* src/memcache.c: When creating a new memory context, don't check
	  to see if an atomic malloc function was provided.  Instead rely
	  on setup ctxt to check to see if one was provided and rely on its
	  logic instead.  If an atomic malloc function is not specified,
	  use the non-atomic malloc function.  Atomic vs non-atomic malloc
	  functions only matter when using memcache(3) in a GC context.

2004-12-24 18:02  sean

	* src/memcache.c: Add mc[m]?_server_disconnect() and
	  mc[m]?_server_disconnect_all().

	  Internally, make use of the static function
	  memcache_server_init().

2004-12-24 17:58  sean

	* test/regress/regress.c: Disconnect from the server before we
	  loop.  No need to do this, but I want this test in here to make
	  sure things work right.

2004-12-24 17:35  sean

	* src/memcache.c: Continue my quest to piss of users and rename
	  mc[m]?_find_server() to mc[m]?_server_find().  Apologies to all
	  for this, but I'd rather get this kind of consistency work in now
	  as opposed to gimping along an API that isn't 100% right.

2004-12-23 14:34  sean

	* doc/memcache.4: Add memcache.4, an nroff replacement of the
	  binary protocol document.  Granted the mackup is terrible and
	  should be replaced with proper mdoc(7) markup.  That'll probably
	  happen when I add memcache.3 to the mix. document.  Granted the
	  mackup is terrible and should be replaced with proper mdoc(7)
	  markup.  That'll probably happen when I add memcache.3 to the
	  mix. document.  Granted the mackup is terrible and should be
	  replaced with proper mdoc(7) markup.	That'll probably happen
	  when I add memcache.3 to the mix. document.  Granted the mackup
	  is terrible and should be replaced with proper mdoc(7) markup.
	  That'll probably happen when I add memcache.3 to the mix.

2004-12-22 14:21  sean

	* src/memcache.c: Piss more people off (sorry!!!), but hopefully
	  not.	Rename mc[m]?_deactivate_server() to
	  mc[m]?_server_deactivate().

	  Add mc[m]?_server_activate_all() which iterates through all
	  available servers and activates servers disabled servers.

2004-12-22 13:43  sean

	* src/memcache.c: Change the API for mc[m]?_flush_all().  This is a
	  better interface and more flexible.  People should be able to
	  figure out a server on their own using the existing API: no sense
	  in providing duplicate functionality at the expense of
	  consistency.

2004-12-20 22:04  sean

	* .cvsignore: Ignore the regress program.

2004-12-20 13:54  sean

	* test/regress/regress.c: Fix bug in regression tests.	Guess I
	  should've read the warning I wrote in memcache.h.

2004-12-20 13:53  sean

	* .cvsignore: Add ChangeLog to the list of ignored files

2004-12-20 13:50  sean

	* test/regress/regress.c: Add a set of callback tests.

	  Use MCM_CSTRLEN() instead of strlen(3).

2004-12-20 13:38  sean

	* src/memcache.c: *) Add a globally defined MCM_CSTRLEN() macro
	  that uses sizeof() instead of    strlen() to find the size of a
	  string.  This only works for const char *    strings that are
	  compiled in to the binary (ie, do: MCM_CSTRLEN("foo")    but
	  don't do: MCM_CSTRLEN(key)).

	  *) Add fetch callback functionality.	All get/refresh commands
	  can now    execute a callback.  This adds zero overhead in the
	  event that a user    doesn't want callbacks.	Performance is the
	  name of the game here.  See	 the following commit to regress.c
	  for an example.  Callbacks are    registered through the
	  mc[m]?_res_register_fetch_cb() function.

	  *) Internally, use MCM_CSTRLEN() instead of CSTRLEN().

	  *) Set the attempted bit after we call mcm_retrieve_data().

	  *) Add stats for refresh bits.

2004-12-20 12:38  sean

	* test/regress/regress.c: Fixup regress.c to match my coding
	  standards.  Various whitespace fixes, remove a global variable,
	  etc.

2004-12-20 10:28  sean

	* src/memcache.c: Add mc[m]?_res_attempted(), mc[m]?_res_found().
	  mcm_res_attempted() returns 1 if the given response object has
	  been through a get attempt.  mcm_res_found() returns 1 if a given
	  response object contains valid data.

	  Minor whitespace cleanup from John McCaskey's patches.

	  Shuffled a ton of the header around to allow for the next commit,
	  a callback interface.

2004-12-20 10:22  sean

	* INSTALL: Rename the switch debug_cflags to just debug.  pmk -e
	  debug is much more sane.

2004-12-17 23:41  sean

	* test/regress/regress.c: Add additional regression tests from John
	  McCaskey.  These are most helpful and will hopefully be added to
	  and will keep folks out of trouble.

2004-12-17 23:40  sean

	* src/memcache.c: Small fix from John McCaskey that allows
	  multi-get's to populate their appropriate struct.  As things
	  were, all data was ending up in the first key.  This problem has
	  only existed since rc1 and wasn't present in the past.

2004-12-16 17:00  sean

	* src/memcache.c: Change MC_RES_* to MCM_RES_*.  Alias MC_RES_* to
	  its MCM_RES_* counter part.  This change was done for
	  consistencies sake so that people can search for mc_* or MC_* in
	  their code and replace it safely with mcm_* or MCM_*.

2004-12-16 16:51  sean

	* src/memcache.c: Add mcMemFreeCtxt(3).

2004-12-16 15:20  sean

	* src/memcache.c: Remove useless check.

2004-12-16 14:53  sean

	* INSTALL: Add a note about building with debug flags

2004-12-16 14:46  sean

	* src/memcache.c: *) Add mcMallocAtomic back to struct
	  memcache_ctxt.  Now that I know what	  "atomic malloc" is
	  supposed to do, make heavy use of it to speed up the	  case
	  where a calling program has garbage collection (ie, boehm).

	  *) Convert the appropriate calls from mcMalloc() to
	  mcMallocAtomic().	Basically do this in all places where we're
	  not allocating a struct.

	  *) This breaks API, so it's best to get this out of the way where
	  possible.

2004-12-16 14:15  sean

	* .cvsignore: Add a few files to ignore (.emacs.desktop,
	  .gdb_history)

2004-12-16 14:14  sean

	* test/regress/regress.c: Add a basic regression test suite.

2004-12-16 14:07  sean

	* src/memcache.c: > Addition of function mcm_retrieve_data, which
	  replaces part of the
	  > code in mcm_fetch_line, as well as the code in mcm_get_line
	  when
	  > performing single or multi get commands.  This command checks
	  data is it
	  > is retrived for the VALUE key flags bytes\r\n lines and then
	  ensures
	  > that the amount of data read matches up with they recieved
	  bytes values.
	  > This is the only safe way to read data as assuming the \r\n is
	  the end
	  > of a response or even that END\r\n is the end is unsafe as the
	  data
	  > itself may be arbitrary binary data.

	  Submitted by: 		  John McCaskey <johnm@klir.com>
	  Minor Editorializations/tweaks:  sean

2004-12-16 13:54  sean

	* src/memcache.c: Update to mcm_get_line(3).  In the words of the
	  patch author:

	  *) removing the re-alignment of the mc->buf that was in your
	  original    code, but was made obsolete by my original changes to
	  read everything    the very first call to mcm_get_line, no need
	  to realign if we aren't    going to be reading anymore, just
	  wastes cpu cycles.

	  *) changing the detection of a read of exactly the number of
	  bytes that	was allowed to only double the buffer, but not
	  immediatley cause another    read() as its possible we are at the
	  end.	I realized that it would be    better to just make room,
	  then continue on to the check for the \r\n,	 and only if it is
	  not there read more.	This eliminates the scenario of    an
	  attempted read with no more data that we had previously since my
	    first update.

	  *) check for "\r\n" at the end of the read data and assume if it
	  is	there that we are done reading.  This is not 100% safe for
	  a get command    or for the stats command.  The get command is
	  handled by the next patch    which makes it not use mcm_get_line,
	  the stats command I'm not too    worried about, but my additional
	  checking for END\r\n if the command is    a stats command could
	  be added back in (I removed it as it sounded like    you were
	  unsure about this additional checking...)

	  Submitted by:   John McCaskey <johnm@klir.com>

2004-12-16 13:38  sean

	* src/memcache.c: Fix a memory leak in mcm_free(3) where I wasn't
	  free(3)'ing the server list itself.

	  Submitted by:   John McCaskey <johnm@klir.com>

2004-12-11 09:40  sean

	* src/memcache.c: bwahahahahaha!  No wonder perl's hashing function
	  wasn't working right: I forgot to advance the pointer.  This
	  makes much more sense now.

	  Submitted by:   Bob Starr <rstarr@laserbeans.com>

2004-12-08 15:53  sean

	* src/memcache.c: Fix a few errors with the reading of data.

	  Submitted by:   John McCaskey <johnm@klir.com>

2004-12-08 11:56  sean

	* src/memcache.c: *) Move to having multiple memory contexts and
	  add its supporting API.  *) Nuke calls of sizeof("foo") - 1 and
	  replace with the macro CSTRLEN("foo")

2004-12-07 16:26  sean

	* INSTALL: Add a basic INSTALL file

2004-12-07 16:25  sean

	* src/memcache.c: Fix a few critical bugs with realloc(3) and in
	  the case where a newline hasn't been found in GET_INIT_BUF_SIZE
	  bytes.

	  Submitted by:   John McCaskey <johnm@klir.com>

2004-12-07 11:20  sean

	* src/memcache.c: Ah ha!  The strlen() -> sizeof() operation has
	  completed!  This should yield a small performance improvement,
	  hopefully.

2004-12-07 11:12  sean

	* src/memcache.c: Fix a rather nasty and large bug with the free on
	  delete handling.  Instead of using:

	  if (res->_flags & (MC_RES_FREE_ON_DELETE |
	  MC_RES_NO_FREE_ON_DELETE)) {

	  which would return true if *either* flag was set, use the more
	  precise and correct version:

	  if (res->_flags & (MC_RES_FREE_ON_DELETE |
	  MC_RES_NO_FREE_ON_DELETE) ==	   (MC_RES_FREE_ON_DELETE |
	  MC_RES_NO_FREE_ON_DELETE)) {

	  which solves the problem with mc_aget(3) and likely a host of
	  other bugs.

2004-12-06 17:21  sean

	* .cvsignore: Ignore .dylib and .so files

2004-12-06 17:17  sean

	* .cvsignore, src/memcache.c: I'm tired of chasing bugs in this due
	  to improper version control.	Add to my corporate CVS repository
	  until such time as its incorporated into the official
	  memcached(8) repository.

