changeset 1082:b5e9472021cc

merge
author Jorge Arellano Cid <jcid@dillo.org>
date Thu, 07 May 2009 16:28:16 -0400
parents 9003bfb74965 (current diff) 5037653f64a4 (diff)
children a7f1763fd21e 4d3828de8290
files
diffstat 1 files changed, 4 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/cache.c	Thu May 07 21:08:41 2009 +0200
+++ b/src/cache.c	Thu May 07 16:28:16 2009 -0400
@@ -136,18 +136,6 @@
 /* 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_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;