(oaf time stamp problem) again



I submitted a patch to fix the oaf timestamp problem back in October, but
didn't get any feedback at the time. So here it is again.

If you like it, could you please commit it. I really need this fixed for
my current project.

Thanks

     Troy D. Gillette - Principal Software Developer - TurboLinux, Inc.
_____________________________________.oOo.____________________________________
Barometer, n.:
An ingenious instrument which indicates what kind of weather we are having.
    -- Ambrose Bierce, "The Devil's Dictionary"


diff -Naur oaf.bak/idl/oaf.idl oaf/idl/oaf.idl
--- oaf.bak/idl/oaf.idl	Thu Oct  5 21:25:32 2000
+++ oaf/idl/oaf.idl	Fri Oct 27 10:58:26 2000
@@ -126,7 +126,7 @@
 			UNREGISTER_NOTIFY_UNUSED /* For factories to use */
 		};
                 ServerInfoListCache get_servers (in CacheTime only_if_newer);
-                ServerStateCache get_active_servers (in CacheTime only_if_newer);
+                ServerStateCache get_active_servers (inout CacheTime only_if_newer);
                 
                 readonly attribute string username, hostname, domain;
 
diff -Naur oaf.bak/oafd/ac-corba.c oaf/oafd/ac-corba.c
--- oaf.bak/oafd/ac-corba.c	Fri Oct 20 03:14:56 2000
+++ oaf/oafd/ac-corba.c	Fri Oct 27 11:01:08 2000
@@ -115,7 +115,7 @@
 	OAF_ServerStateCache *cache;
 
 	cache = OAF_ObjectDirectory_get_active_servers (child->obj,
-							child->time_active_pulled,
+							&(child->time_active_pulled),
 							ev);
 	if (ev->_major != CORBA_NO_EXCEPTION) {
 		child_od_exception (child, ev);
@@ -130,7 +130,6 @@
 
 		child->active_server_list = cache;
 
-		child->time_active_pulled = time (NULL);
 		child->active_servers =
 			g_hash_table_new (g_str_hash, g_str_equal);
 		g_hash_table_freeze (child->active_servers);
diff -Naur oaf.bak/oafd/od-corba.c oaf/oafd/od-corba.c
--- oaf.bak/oafd/od-corba.c	Mon Sep 25 16:36:55 2000
+++ oaf/oafd/od-corba.c	Fri Oct 27 11:00:53 2000
@@ -73,7 +73,7 @@
 
 static OAF_ServerStateCache
 	* impl_OAF_ObjectDirectory_get_active_servers
-	(impl_POA_OAF_ObjectDirectory * servant, OAF_CacheTime only_if_newer,
+	(impl_POA_OAF_ObjectDirectory * servant, OAF_CacheTime *only_if_newer,
 	 CORBA_Environment * ev);
 
 static CORBA_char
@@ -284,6 +284,7 @@
 	newservant->attr_domain = g_strdup (domain);
 	newservant->attr_hostID = oaf_hostname_get ();
 	newservant->by_iid = NULL;
+	newservant->time_active_changed = 0;
 
         newservant->registry_source_directories = g_strsplit (registry_path, ":", -1);
         newservant->registry_directory_mtimes = g_hash_table_new (g_str_hash, g_str_equal);
@@ -313,6 +314,7 @@
 		CORBA_sequence_set_release (&retval->_u.server_list,
 					    CORBA_FALSE);
 	}
+	only_if_newer = servant->time_active_changed;
 
 	return retval;
 }
@@ -333,14 +335,14 @@
 static OAF_ServerStateCache *
 impl_OAF_ObjectDirectory_get_active_servers (impl_POA_OAF_ObjectDirectory *
 					     servant,
-					     OAF_CacheTime only_if_newer,
+					     OAF_CacheTime *only_if_newer,
 					     CORBA_Environment * ev)
 {
 	OAF_ServerStateCache *retval;
 
 	retval = OAF_ServerStateCache__alloc ();
 
-	retval->_d = (only_if_newer < servant->time_active_changed);
+	retval->_d = (*only_if_newer < servant->time_active_changed);
 	if (retval->_d) {
 		StateCollectionInfo sci;
 
@@ -356,6 +358,7 @@
 		CORBA_sequence_set_release (&(retval->_u.active_servers),
 					    CORBA_TRUE);
 	}
+	*only_if_newer = servant->time_active_changed;
 
 	return retval;
 }
@@ -509,7 +512,7 @@
 	g_hash_table_insert (servant->active_servers,
 			     oldobj ? iid : g_strdup (iid),
 			     CORBA_Object_duplicate (obj, ev));
-	servant->time_active_changed = time (NULL);
+	servant->time_active_changed++;
 
 	return OAF_REG_SUCCESS;
 }
@@ -535,5 +538,5 @@
 	g_free (orig_iid);
 	CORBA_Object_release (orig_obj, ev);
 
-	servant->time_active_changed = time (NULL);
+	servant->time_active_changed++;
 }
 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]