some fixes on startupload. does not work yet
authorAleš Křenek <ljocha@ics.muni.cz>
Fri, 3 Jun 2005 13:17:07 +0000 (13:17 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Fri, 3 Jun 2005 13:17:07 +0000 (13:17 +0000)
org.glite.jp.primary/examples/jpps-test.c
org.glite.jp.primary/src/mysql.c
org.glite.jp.primary/src/new_ftp_backend.c
org.glite.jp.primary/src/soap_ops.c

index c7c3e6d..f273fe0 100644 (file)
@@ -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]);
index 2a6f7c0..0f080ce 100644 (file)
@@ -10,6 +10,7 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <time.h>
+#include <limits.h>
 
 #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);
        
index 169e326..8d1697b 100644 (file)
@@ -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);
index 6a2fe79..2571554 100644 (file)
@@ -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;