From b3c97dd8c01e48e5c69a68a865ccdf3d2e2b9647 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/OpenSRF/trunk@574 9efc2488-bf62-4759-914b-345cdb29e865 --- src/libstack/osrf_system.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/libstack/osrf_system.c b/src/libstack/osrf_system.c index ea5aca4..6bacb95 100644 --- a/src/libstack/osrf_system.c +++ b/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.11.0