From: Aleš Křenek Date: Thu, 9 Jun 2005 12:00:58 +0000 (+0000) Subject: Don't return uncommitted files for GetJob X-Git-Tag: gridsite-core_R_1_1_9~3 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=f6914f145151ec80bf7f2909af42abd156f5e0c5;p=jra1mw.git Don't return uncommitted files for GetJob --- diff --git a/org.glite.jp.primary/src/new_ftp_backend.c b/org.glite.jp.primary/src/new_ftp_backend.c index be620e4..14b701b 100644 --- a/org.glite.jp.primary/src/new_ftp_backend.c +++ b/org.glite.jp.primary/src/new_ftp_backend.c @@ -752,6 +752,8 @@ int glite_jppsbe_get_job_url( } goto error_out; } + + free(stmt); stmt = NULL; db_retn = glite_jp_db_fetchrow(db_res, db_row); if (db_retn != 3) { @@ -784,6 +786,22 @@ int glite_jppsbe_get_job_url( goto error_out; } + trio_asprintf(&stmt,"select 'x' from files where jobid='%|Ss' " + "and ext_url = '%|Ss' " + "and state='committed' ",ju,*url_out); + + if ((db_retn = glite_jp_db_execstmt(ctx,stmt,&db_res)) <= 0) { + if (db_retn == 0) { + err.code = ENOENT; + err.desc = "not uploaded yet"; + } + else { + err.code = EIO; + err.desc = "DB access failed"; + } + /* goto error_out; */ + } + error_out: free(db_row[0]); free(db_row[1]); free(stmt);