DEBUG:=-g -O0 -DDEBUG
-CFLAGS:=${DEBUG} -I. -I${top_srcdir}/interface -I${top_srcdir}/src -I${gsoap_prefix}/include -I${stagedir}/include ${GLOBUS_CFLAGS}
+CFLAGS:=${DEBUG} -I. -I${top_srcdir}/interface -I${top_srcdir}/src -I${gsoap_prefix}/include -I${stagedir}/include ${GLOBUS_CFLAGS} -I${mysql_prefix}/include -I${mysql_prefix}/include/mysql
LDFLAGS:=-L${stagedir}/lib
LINK:=libtool --mode=link ${CC} ${LDFLAGS}
HDRS_S=builtin_plugins.h backend.h
SRCS:= bones_server.c soap_ops.c \
- ftp_backend.c file_plugin.c \
+ new_ftp_backend.c mysql.c file_plugin.c \
feed.c tags.c\
is_client.c \
${ps_prefix}ServerLib.c \
BONESLIB:=-lglite_lb_server_bones
GSOAPLIB:=-lglite_security_gsoap_plugin_${nothrflavour} -lglite_security_gss_${nothrflavour} \
-L${gsoap_prefix}/lib -lgsoap${GSOAP_DEBUG} -L${ares_prefix}/lib -lares
+TRIOLIB:=-lglite_lb_trio
+
+ifneq (${mysql_prefix},/usr)
+ ifeq ($(shell echo ${mysql_version} | cut -d. -f1,2),4.1)
+ MYSQLIB := -L${mysql_prefix}/lib/mysql -lmysqlclient
+ else
+ MYSQLIB := -L${mysql_prefix}/lib -lmysqlclient
+ endif
+else
+ MYSQLIB := -lmysqlclient
+endif
default all: compile
compile: ${daemon} ${example} ${plugins}
${daemon}: ${OBJS}
- ${LINK} -o $@ ${OBJS} ${BONESLIB} ${COMMONLIB} ${GSOAPLIB} ${GLOBUS_LIBS}
+ ${LINK} -o $@ ${OBJS} ${BONESLIB} ${TRIOLIB} ${COMMONLIB} ${GSOAPLIB} ${GLOBUS_LIBS} ${MYSQLIB}
${example}: ${EXA_OBJS}
${LINK} -o $@ ${EXA_OBJS} ${GSOAPLIB} ${GLOBUS_LIBS}
dg_jobid varchar(255) binary not null,
owner char(32) binary not null,
- reg_time datetime not null;
+ reg_time datetime not null,
primary key (jobid),
unique (dg_jobid),
ext_url mediumblob null,
state char(32) binary not null,
- deadline datetime null;
+ deadline datetime null,
ul_userid char(32) binary not null,
primary key (jobid,filename),
- index (ext_url)
+ index (ext_url(255))
);
create table attrs (
Revision history:
$Log$
+ Revision 1.3 2004/11/22 13:55:30 dimeglio
+ First version of this file
+ Use central subsystem definition
+
Revision 1.2 2004/10/15 12:19:28 akrenek
build with gsoap 2.7 too
expat_prefix=${with.expat.prefix}
ares_prefix=${with.ares.prefix}
gsoap_prefix=${with.gsoap.prefix}
+mysql_prefix=${with.mysql.prefix}
+mysql_version=${ext.mysql.version}
thrflavour=${with.globus.thr.flavor}
nothrflavour=${with.globus.nothr.flavor}
cppunit=${with.cppunit.prefix}
#include "db.h"
#define DEFAULTCS "jpps/@localhost:jpps1"
+#define GLITE_JP_LB_MYSQL_VERSION 40018
static int my_err(glite_jp_context_t ctx, char *function)
{
if (!slash || !at || !colon) {
free(buf);
err.code = EINVAL;
- err.desc = "Invalid DB connect string");
+ err.desc = "Invalid DB connect string";
return glite_jp_stack_error(ctx,&err);
}
int glite_jp_db_execstmt(glite_jp_context_t ctx,char *txt,glite_jp_db_stmt_t *stmt)
{
- int err;
+ int merr;
int retry_nr = 0;
int do_reconnect = 0;
do_reconnect = 0;
if (mysql_query((MYSQL *) ctx->dbhandle,txt)) {
/* error occured */
- switch (err = mysql_errno((MYSQL *) ctx->dbhandle)) {
+ switch (merr = mysql_errno((MYSQL *) ctx->dbhandle)) {
case 0:
break;
case ER_DUP_ENTRY:
err.code = EEXIST;
- err.desc = mysql_error((MYSQL *) ctx->dbhandle));
+ err.desc = mysql_error((MYSQL *) ctx->dbhandle);
glite_jp_stack_error(ctx,&err);
return -1;
break;
#include "tags.h"
#include "backend.h"
+#include "db.h"
#define FTPBE_DEFAULT_DB_CS "jpps/@localhost:jpps"
}
if (glite_jp_db_execstmt(ctx, stmt, NULL) < 0) {
- if (ctx->error->code == EEXIST)
+ if (ctx->error->code == EEXIST) {
err.code = EEXIST;
err.desc = "Job already registered";
+ }
else {
err.code = EIO;
err.desc = "DB access failed";
*/
peerhash = str2md5(peername); /* static buffer */
- if (store_user(ctx, peerhash, owner)) {
+ if (store_user(ctx, peerhash, peername)) {
err.code = EIO;
err.desc = "Cannot store upload user entry";
goto error_out;
err.source = __FUNCTION__;
assert(job!=NULL);
- assert(url_out != NULL);
+ assert(fname_out != NULL);
assert(class!=NULL);