Make the configuration store use a serf allocator instead of pools for its
data to allow clearing out values without a (very slow) memory leak.

* config_store.c
  (serf__config_hdr_t): Remove pool.
  (config_free_cb_t): New typedef.
  (config_entry_t): Add free callback.
  (create_config_hdr): Use allocator.
  (add_or_replace_entry): Allow storing how to free value.
  (add_or_replace_entry): Handle free support.
  (config_set_object): New helper function, extracted from
    serf__config_set_object.
  (cleanup_hdr,
   cleanup_store): New function.
  (serf__config_store_init): Create allocator. Hook explicit cleanup.
  (serf__config_store_create_ctx_config,
   serf__config_store_create_conn_config,
   serf__config_store_create_client_config,
   serf__config_store_create_listener_config): Remove out_pool, which is only
     partially used as result pool. Use the context pool directly.
  (serf_config_set_stringc): Use config_set_object and declare how to free.
  (serf_config_set_stringf): Add scratch_pool argument. Update caller.
  (serf_config_set_object): Move some code to config_set_object.

* context.c
  (serf_context_create_ex): Update caller.

* incoming.c
  (serf_incoming_create2,
   serf_listener_create): Update caller.

* outgoing.c
  (serf_connection_create2): Update caller.

* pump.c
  (serf_pump__store_ipaddresses_in_config): Update caller.

* serf.h
  (serf_config_set_stringf): Add argument.

* serf_private.h
  (serf_config_t): Store allocator instead of conn_pool.
  (serf__config_store_t): Store allocator. Update comment.
  (serf__config_store_create_conn_config,
   serf__config_store_create_client_config,
   serf__config_store_create_listener_config,
   serf__config_store_create_ctx_config): Remove argument.


git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1717012 13f79535-47bb-0310-9956-ffa450edef68
7 files changed