set DB connect string to default if not specified either on command line or env....
authorMiloš Mulač <mulac@civ.zcu.cz>
Wed, 2 May 2007 10:38:28 +0000 (10:38 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Wed, 2 May 2007 10:38:28 +0000 (10:38 +0000)
- fixes the  [9226]: DB 'NULL'  message

org.glite.lb.server/interface/lbs_db.h
org.glite.lb.server/src/bkserverd.c
org.glite.lb.server/src/lbs_db.c

index 38c49f6..2fbdc0f 100644 (file)
@@ -15,6 +15,7 @@ extern "C" {
 #define EDG_WLL_MYSQL_VERSION          40001
 #define BUF_INSERT_ROW_ALLOC_BLOCK     1000
 
+#define DEFAULTCS      "lbserver/@localhost:lbserver20"
 
 typedef struct _edg_wll_Stmt *edg_wll_Stmt;
 
index 48a3f96..c50d946 100644 (file)
@@ -574,6 +574,7 @@ a.sin_addr.s_addr = INADDR_ANY;
 #endif /* GLITE_LB_SERVER_WITH_WS */
 
        if (!dbstring) dbstring = getenv("LBDB");
+       if (!dbstring) dbstring = strdup(DEFAULTCS);
 
        /* Just check the database and let it be. The slaves do the job. */
        edg_wll_InitContext(&ctx);
index 80b6b33..a10bd56 100644 (file)
@@ -17,8 +17,6 @@
 #include "glite/lb/context-int.h"
 #include "glite/lb/trio.h"
 
-#define DEFAULTCS      "lbserver/@localhost:lbserver20"
-
 #define my_err() edg_wll_SetError(ctx,EDG_WLL_ERROR_DB_CALL,mysql_error((MYSQL *) ctx->mysql))
 
 struct _edg_wll_Stmt {