From 2abc6303b2734ea1b420556787ed9444d590bf22 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Fri, 3 Jun 2005 13:17:07 +0000 Subject: [PATCH] some fixes on startupload. does not work yet --- org.glite.jp.primary/examples/jpps-test.c | 2 +- org.glite.jp.primary/src/mysql.c | 4 ++++ org.glite.jp.primary/src/new_ftp_backend.c | 6 +++--- org.glite.jp.primary/src/soap_ops.c | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/org.glite.jp.primary/examples/jpps-test.c b/org.glite.jp.primary/examples/jpps-test.c index c7c3e6d..f273fe0 100644 --- a/org.glite.jp.primary/examples/jpps-test.c +++ b/org.glite.jp.primary/examples/jpps-test.c @@ -132,7 +132,7 @@ int main(int argc,char *argv[]) in.job = argv[2]; in.class_ = argv[3]; in.name = NULL; - in.commitBefore = atoi(argv[4]); + in.commitBefore = atoi(argv[4]) + time(NULL); in.contentType = argv[5]; if (argc != 6) usage(argv[0]); diff --git a/org.glite.jp.primary/src/mysql.c b/org.glite.jp.primary/src/mysql.c index 2a6f7c0..0f080ce 100644 --- a/org.glite.jp.primary/src/mysql.c +++ b/org.glite.jp.primary/src/mysql.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "glite/jp/types.h" #include "glite/jp/context.h" @@ -207,6 +208,9 @@ char *glite_jp_db_timetodb(time_t t) struct tm *tm = gmtime(&t); char tbuf[256]; + /* XXX: the very end of our days */ + if (!tm && t == (time_t) LONG_MAX) return strdup("9999-12-31 23:59:59"); + sprintf(tbuf,"'%4d-%02d-%02d %02d:%02d:%02d'",tm->tm_year+1900,tm->tm_mon+1, tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec); diff --git a/org.glite.jp.primary/src/new_ftp_backend.c b/org.glite.jp.primary/src/new_ftp_backend.c index 169e326..8d1697b 100644 --- a/org.glite.jp.primary/src/new_ftp_backend.c +++ b/org.glite.jp.primary/src/new_ftp_backend.c @@ -409,14 +409,14 @@ int glite_jppsbe_start_upload( } peername = glite_jp_peer_name(ctx); - if (peername = NULL) { + if (peername == NULL) { err.code = EINVAL; err.desc = "Cannot obtain client certificate info"; goto error_out; } trio_asprintf(&stmt, "select owner, reg_time from jobs" - "where jobid='%|Ss'", ju); + " where jobid='%|Ss'", ju); if (!stmt) { err.code = ENOMEM; @@ -489,7 +489,7 @@ int glite_jppsbe_start_upload( free(stmt); stmt = NULL; trio_asprintf(&stmt,"insert into files" - "(jobid,filename,int_path,ext_path,state,deadline,ul_userid) " + "(jobid,filename,int_path,ext_url,state,deadline,ul_userid) " "values ('%|Ss','%|Ss','%|Ss','%|Ss','%|Ss', '%|Ss', '%|Ss')", ju, data_basename, data_fname, destination_out, "uploading", glite_jp_db_timetodb(*commit_before_inout), peerhash); diff --git a/org.glite.jp.primary/src/soap_ops.c b/org.glite.jp.primary/src/soap_ops.c index 6a2fe79..2571554 100644 --- a/org.glite.jp.primary/src/soap_ops.c +++ b/org.glite.jp.primary/src/soap_ops.c @@ -126,7 +126,7 @@ SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__StartUpload( { CONTEXT_FROM_SOAP(soap,ctx); char *destination; - time_t commit_before; + time_t commit_before = in->commitBefore; glite_jp_error_t err; glite_jpps_fplug_data_t **pd = NULL; int i; -- 1.8.2.3