diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2009-05-07 16:28:16 -0400 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2009-05-07 16:28:16 -0400 |
commit | a975d5033ed5905cd05b08bf752851325d34a0a7 (patch) | |
tree | e723368f206a905a6315e318154f93be50c2faf2 | |
parent | ee688a046da0c825d850f048b222ec17daf614bb (diff) | |
parent | 8841aa7963f24cc2384ba57bb1d5e69e74269fd1 (diff) |
merge
-rw-r--r-- | src/cache.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/cache.c b/src/cache.c index ae8a512d..8ac859ac 100644 --- a/src/cache.c +++ b/src/cache.c @@ -136,18 +136,6 @@ void a_Cache_init(void) /* Client operations ------------------------------------------------------ */ /* - * Make a unique primary-key for cache clients - */ -static int Cache_client_make_key(void) -{ - static int ClientKey = 0; /* Provide a primary key for each client */ - - if (++ClientKey <= 0) - ClientKey = 1; - return ClientKey; -} - -/* * Add a client to ClientQueue. * - Every client-field is just a reference (except 'Web'). * - Return a unique number for identifying the client. @@ -155,11 +143,13 @@ static int Cache_client_make_key(void) static int Cache_client_enqueue(const DilloUrl *Url, DilloWeb *Web, CA_Callback_t Callback, void *CbData) { - int ClientKey; + static int ClientKey = 0; /* Provide a primary key for each client */ CacheClient_t *NewClient; + if (++ClientKey <= 0) + ClientKey = 1; + NewClient = dNew(CacheClient_t, 1); - ClientKey = Cache_client_make_key(); NewClient->Key = ClientKey; NewClient->Url = Url; NewClient->Version = 0; |