Check sockets from connection pool before using them and try to reconnect
them if they are not usable any longer.

* memcache/apr_memcache.c::ms_find_conn:
    Check if the socket returned from the connection pool is still readable. If
    not then invalidate the connection in the pool and request a new one
    from the connection pool. Repeat this until a valid socket is returned
    or this was done the maximum number of connections in the pool plus one.
    This ensures that at least one new socket was created. If a new socket
    does not work this indicates a broken backend and not just a restart in
    the past. In this case return an error like previously.

* test/testmemcache.c:
    Add new test for connection validation.

* test/memcachedmock.c:
    For the new test we need a memcached mock server that we control and
    can restart.

* test/testmemcache.h:
    Shared defines between test/testmemcache.c and test/memcachedmock.c.

* test/Makefile.in:
* test/Makefile.win:
* test/NWGNUmakefile:
* test/NWGNUmemcachedmock:
    Needed changes to build test/memcachedmock.c on different platforms.


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1909585 13f79535-47bb-0310-9956-ffa450edef68
8 files changed