*/
+#include <sys/types.h>
+#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
purge_quit = 1;
}
+static char *glite_location() {
+ char *location = NULL;
+ struct stat info;
+
+ if (!(location = getenv("GLITE_LB_LOCATION")))
+ if (!(location = getenv("GLITE_LOCATION")))
+ {
+ if (stat("/opt/glite/interfaces", &info) == 0 && S_ISDIR(info.st_mode))
+ location = "/opt/glite";
+ else
+ if (stat("/usr/interfaces", &info) == 0 && S_ISDIR(info.st_mode))
+ location = "/usr";
+ }
+
+ return location;
+}
+
edg_wll_ErrorCode edg_wll_ProtoV21(edg_wll_Context ctx,
char *request,char **headers,char *messageBody,
char **response,char ***headersOut,char **bodyOut)
#define WSDL_LB4AGU "lb4agu.wsdl"
} else if (strncmp(requestPTR, "/?wsdl", strlen("/?wsdl")) == 0) {
char *filename;
- asprintf(&filename, "%s/interface/%s", getenv("GLITE_LOCTION"), WSDL_LB);
+ asprintf(&filename, "%s/interface/%s", glite_location(), WSDL_LB);
if (edg_wll_WSDLOutput(ctx, &message, filename))
ret = HTTP_INTERNAL;
free(filename);
/* GET /?types */
} else if (strncmp(requestPTR, "/?types", strlen("/?types")) == 0) {
char *filename;
- asprintf(&filename, "%s/interface/%s", getenv("GLITE_LOCTION"), WSDL_LBTYPES);
+ asprintf(&filename, "%s/interface/%s", glite_location(), WSDL_LBTYPES);
if (edg_wll_WSDLOutput(ctx, &message, filename))
ret = HTTP_INTERNAL;
free(filename);
/* GET /?agu */
} else if (strncmp(requestPTR, "/?agu", strlen("/?agu")) == 0) {
char *filename;
- asprintf(&filename, "%s/interface/%s", getenv("GLITE_LOCTION"), WSDL_LB4AGU);
+ asprintf(&filename, "%s/interface/%s", glite_location(), WSDL_LB4AGU);
if (edg_wll_WSDLOutput(ctx, &message, filename))
ret = HTTP_INTERNAL;
free(filename);