summaryrefslogtreecommitdiff
path: root/gui/gdmconfig.c
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2006-02-07 23:57:27 +0000
committerBrian Cameron <bcameron@src.gnome.org>2006-02-07 23:57:27 +0000
commit55230e8582165a3b96fe7e664428deec46ffeef6 (patch)
tree2508920aa5ae737297adfc929709f8aa5b029710 /gui/gdmconfig.c
parentbe18056421a0241a2843e1a65727da2b8f390b68 (diff)
downloadgdm-55230e8582165a3b96fe7e664428deec46ffeef6.tar.gz
This patch resolves some performance issues that I noticed when testing
2006-02-07 Brian Cameron <brian.cameron@sun.com> This patch resolves some performance issues that I noticed when testing GDM with the gdmdynamic command. I notice that waiting for the sockets to timeout made gdmdynamic slower so now all the clients load all the configuration data in one quick pass and close the socket. Since the gdm_config_get functions cache the data, the slaves will not go over the socket to get the data again unless asked to reread. Bump the maximum messages over the socket from 20 to 80 because gdmlogin pulls about 65 configuration parms over and this allows all data to be accessed in one connection (and gives a little room for growth). Improved the way GDM slaves deal with syslog so all slaves use the same interfaces. Added three missing keys to the daemon configuration handling code. * daemon/gdmconfig.c: Add three keys that were missing for background program support. * gui/gdmcomm.[ch]: Now if there is a failure connecting to the daemon, the slave will sleep 1 second before retry (normally retries 5 times). If all retries fail, it will not try sleeping on subsequent calls to the daemon. This greatly improves performance when the daemon is flooded with slave requests. In normal usage, this will likely not happen, but it is good for GDM to not fail so easily. Added better debug. Added gdm_comm_close function so that slaves can ask to close the socket when done reading config. Now uses common syslog functions. * daemon/gdm.h: Add better comments, rename GDM_SUP_MAX_CONNECTIONS to GDM_SUP_MAX_MESSAGES which is more accurate, and bump the max number to 80. * gui/gdmcommon.h, gui/gdmwm.h, gui/gdmsession.h: Added common syslog functions to gdmcommon.h and moved some functions that were in gdmcommon.h to gdmwm.h and gdmsession.h since the implementations were in those c-files. Renamed functions to make naming consistant. * gui/gdmXnestchooser, gui/gdmchooser.c, gui/gdmcommon.c, gui/gdmconfig.c, gui/gdmdynamic.c, gui/gdmflexiserver.c, gui/gdmlogin.c, gui/gdmphotosetup.c, gui/gdmsession.c, gui/gdmwm.c, gui/greeter/greeter.c, gui/greeter/greeter_item_ulist.c, gui/greeter/greeter_session.c, gui/greeter/greeter_system.c: Slaves close sockets connection when done reading config. Now slaves use common syslog functions. Naming changes to reflect renaming of functions in gdmcommon.h/gdmwm.h/gdmsession.h. Better debug. * daemon/auth.c, daemon/cookie.c, daemon/display.c, daemon/gdm.c, daemon/gdm-net.c, daemon/misc.c, daemon/slave.c, daemon/xdmcp.c, gui/gdmlanguages.c, gui/greeter/greeter_canvas_item.c, gui/gdmsetup.c, vicious-extensions/ve-config.c: Make spacing around "++" more consistant. Add better debug in some functions
Diffstat (limited to 'gui/gdmconfig.c')
-rw-r--r--gui/gdmconfig.c42
1 files changed, 7 insertions, 35 deletions
diff --git a/gui/gdmconfig.c b/gui/gdmconfig.c
index df447e71..c5172331 100644
--- a/gui/gdmconfig.c
+++ b/gui/gdmconfig.c
@@ -22,7 +22,6 @@
*/
#include <stdlib.h>
-#include <syslog.h>
#include <gtk/gtk.h>
#include "config.h"
@@ -38,19 +37,6 @@ static GHashTable *bool_hash = NULL;
static GHashTable *string_hash = NULL;
static gboolean gdm_never_cache = FALSE;
-/*
- * Hack to keep track if config functions should be printing error messages
- * to syslog or stdout
- */
-static gboolean using_syslog = FALSE;
-
-void
-gdm_openlog (const char *ident, int logopt, int facility)
-{
- openlog (ident, logopt, facility);
- using_syslog = TRUE;
-}
-
/**
* gdm_config_never_cache
*
@@ -140,7 +126,6 @@ gdm_config_get_result (gchar *key)
return result;
}
-
/**
* gdm_config_get_xserver_details
*
@@ -162,10 +147,7 @@ gdm_config_get_xserver_details (gchar *xserver, gchar *key)
if (! result || ve_string_empty (result) ||
strncmp (result, "OK ", 3) != 0) {
- if (using_syslog)
- syslog (LOG_ERR, "Could not access xserver configuration");
- else
- printf ("Could not access xserver configuration");
+ gdm_common_info ("Could not access xserver configuration");
if (result)
g_free (result);
@@ -203,10 +185,7 @@ gdm_config_get_xservers (gboolean flexible)
if (! result || ve_string_empty (result) ||
strncmp (result, "OK ", 3) != 0) {
- if (using_syslog)
- syslog (LOG_ERR, "Could not access xserver configuration");
- else
- printf ("Could not access xserver configuration");
+ gdm_common_info ("Could not access xserver configuration");
if (result)
g_free (result);
@@ -327,11 +306,9 @@ _gdm_config_get_string (gchar *key, gboolean reload, gboolean *changed, gboolean
if (! result || ve_string_empty (result) ||
strncmp (result, "OK ", 3) != 0) {
+ /* No need to show error for failed translated strings */
if (show_error) {
- if (using_syslog)
- syslog (LOG_ERR, "Could not access configuration key %s", key);
- else
- printf ("Could not access configuration key %s\n", key);
+ gdm_common_info ("Could not access configuration key %s", key);
}
if (result)
@@ -360,6 +337,7 @@ _gdm_config_get_string (gchar *key, gboolean reload, gboolean *changed, gboolean
*changed = FALSE;
}
+ g_free (*hashretval);
*hashretval = temp;
return *hashretval;
}
@@ -453,10 +431,7 @@ _gdm_config_get_int (gchar *key, gboolean reload, gboolean *changed)
if (! result || ve_string_empty (result) ||
strncmp (result, "OK ", 3) != 0) {
- if (using_syslog)
- syslog (LOG_ERR, "Could not access configuration key %s", key);
- else
- printf ("Could not access configuration key %s\n", key);
+ gdm_common_info ("Could not access configuration key %s", key);
if (result)
g_free (result);
@@ -524,10 +499,7 @@ _gdm_config_get_bool (gchar *key, gboolean reload, gboolean *changed)
if (! result || ve_string_empty (result) ||
strncmp (result, "OK ", 3) != 0) {
- if (using_syslog)
- syslog (LOG_ERR, "Could not access configuration key %s", key);
- else
- printf ("Could not access configuration key %s\n", key);
+ gdm_common_info ("Could not access configuration key %s", key);
if (result)
g_free (result);