From 3061985b3648283e6ec8e8b5e6250b2ad80ca7be Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 7 Nov 2005 23:16:22 +0000 Subject: [PATCH] rolling back hostname change because of mysterious performance problem needs investigations when time permits.. git-svn-id: svn://svn.open-ils.org/ILS/trunk@1983 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- OpenSRF/src/libstack/osrf_system.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/OpenSRF/src/libstack/osrf_system.c b/OpenSRF/src/libstack/osrf_system.c index ea5aca4703..6bacb95064 100644 --- a/OpenSRF/src/libstack/osrf_system.c +++ b/OpenSRF/src/libstack/osrf_system.c @@ -3,8 +3,6 @@ #include "osrf_application.h" #include "osrf_prefork.h" -char* __osrfSystemHostname = NULL; - void __osrfSystemSignalHandler( int sig ); transport_client* __osrfGlobalTransportClient; @@ -60,8 +58,6 @@ int _osrfSystemInitCache() { int osrfSystemBootstrap( char* hostname, char* configfile, char* contextNode ) { if( !(hostname && configfile && contextNode) ) return -1; - __osrfSystemHostname = strdup(hostname); - /* first we grab the settings */ if(!osrfSystemBootstrapClientResc(configfile, contextNode, "settings_grabber" )) { return fatal_handler("Unable to bootstrap"); @@ -172,15 +168,15 @@ int osrf_system_bootstrap_client_resc( char* config_file, char* contextnode, cha transport_client* client = client_init( domain, iport, unixpath, 0 ); char* host; - if(__osrfSystemHostname) host = __osrfSystemHostname; - else host = getenv("HOSTNAME"); - if( host == NULL ) host = ""; + host = getenv("HOSTNAME"); + if(!host) host = ""; if(!resource) resource = ""; + int len = strlen(resource) + 256; char buf[len]; memset(buf,0,len); - snprintf(buf, len - 1, "opensrf_%s_%s_%d", resource, host, getpid() ); + snprintf(buf, len - 1, "%s_%s_%d", resource, host, getpid() ); if(client_connect( client, username, password, buf, 10, AUTH_DIGEST )) { /* child nodes will leak the parents client... but we can't free -- 2.43.2