[Initng-svn] r3834 - in initng/trunk: src
svn at initng.thinktux.net
svn at initng.thinktux.net
Tue Apr 18 18:23:30 CEST 2006
Author: jimmy
Date: Tue Apr 18 18:23:29 2006
New Revision: 3834
Modified:
initng/trunk/plugins/iparser/initng_i_parser.c
initng/trunk/src/initng_common.c
initng/trunk/src/initng_service_cache.c
Log:
Feature removed by thelich that we can add one wildcard service to file_cache, instead duplicate one every time was reenabled.
This features: 1) Only one read of the complete .i file from disk, for serverl services
2) Lower memory usabe, 3) better boot speed, thelich, please tell me why you removed this one in the first place!
Modified: initng/trunk/plugins/iparser/initng_i_parser.c
==============================================================================
--- initng/trunk/plugins/iparser/initng_i_parser.c (original)
+++ initng/trunk/plugins/iparser/initng_i_parser.c Tue Apr 18 18:23:29 2006
@@ -615,23 +615,6 @@
if (service_match(watch_for, new_service->name) == TRUE)
{
D_("MATCH Found :%s\n", new_service->name);
-
- /* Just explanation - will erase later (TheLich):
- * don't keep services with wildcards in service_cache
- * thus there is each separate copy for each service, that
- * was created from wildcard service and now all services
- * in service cache will have unique names (no need in
- * pattern search when looking for service). This is because
- * of new behaviour of initng parser (adding to cache only that
- * service which was asked). If we will not do that, then if
- * wildcard service exists in database and we want to add *real*
- * service, which matches this wildcard - it will not be added,
- * wildcard service will be used instead. (daemon/getty/ * and
- * daemon/getty/1 is a good example).
- */
-
- free(new_service->name);
- new_service->name = i_strdup(watch_for);
(*match) = new_service;
return (TRUE);
}
Modified: initng/trunk/src/initng_common.c
==============================================================================
--- initng/trunk/src/initng_common.c (original)
+++ initng/trunk/src/initng_common.c Tue Apr 18 18:23:29 2006
@@ -192,17 +192,6 @@
return (TRUE);
}
- /* check the cache database for an exact match */
- if ((service->from_service =
- initng_service_cache_find_by_exact_name(service->name)))
- {
- service->type = service->from_service->type;
- service->data.res = &service->from_service->data;
- D_("get_service(%s): found service in service database!\n",
- service->name);
- return (TRUE);
- }
-
/* try parse with dynamic loaded parsers */
if (!(service->from_service = initng_common_parse_service(service->name)))
{
@@ -323,6 +312,7 @@
{
s_call *current, *safe = NULL;
service_cache_h *service = NULL;
+ D_("initng_common_parse_service(%s);\n", name);
/* first check service cache */
service = initng_service_cache_find_by_name(name);
Modified: initng/trunk/src/initng_service_cache.c
==============================================================================
--- initng/trunk/src/initng_service_cache.c (original)
+++ initng/trunk/src/initng_service_cache.c Tue Apr 18 18:23:29 2006
@@ -176,12 +176,10 @@
/* first give the exact find a shot */
if ((current = initng_service_cache_find_by_exact_name(service)))
+ {
return (current);
+ }
- /* did not find any */
- return NULL;
-
- /* no need in pattern matching, because of unique names in cache (TheLich) */
/* walk the active db and compere */
current = NULL;
@@ -197,10 +195,13 @@
* might have an '*' or '?'
*/
if (service_match(service, current->name))
+ {
+ D_("(%s, %s) MATCH\n", service, current->name);
return (current);
+ }
}
-
+ return(NULL);
}
/*
More information about the Initng-svn
mailing list