break;
/* soft errors - some useful data may be returned too */
case HTTP_UNAUTH: /* EPERM */
+ case HTTP_GONE: /*EIDRM*/
case HTTP_NOTFOUND: /* ENOENT */
case HTTP_NOTIMPL: /* ENOSYS */
case HTTP_UNAVAIL: /* EAGAIN */
#define HTTP_UNAUTH 401
#define HTTP_NOTFOUND 404
#define HTTP_NOTALLOWED 405
+#define HTTP_GONE 410
#define HTTP_UNSUPPORTED 415
#define HTTP_INTERNAL 500
#define HTTP_NOTIMPL 501
case EEXIST:
case EDG_WLL_ERROR_NOINDEX:
case E2BIG:
- glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_WARN,
- "[%d] %s (%s)", getpid(), errt, errd);
- break;
+ case EIDRM:
case EINVAL:
case EDG_WLL_ERROR_PARSE_BROKEN_ULM:
case EDG_WLL_ERROR_PARSE_EVENT_UNDEF:
case HTTP_INTERNAL: msg = "Internal Server Error"; break;
case HTTP_UNAVAIL: msg = "Service Unavailable"; break;
case HTTP_INVALID: msg = "Invalid Data"; break;
+ case HTTP_GONE: msg = "Gone"; break;
default: msg = "Unknown error"; break;
}
break;
case ENOENT: ret = HTTP_NOTFOUND; break;
case EPERM: ret = HTTP_UNAUTH; break;
+ case EIDRM: ret = HTTP_GONE; break;
case EDG_WLL_ERROR_NOINDEX: ret = HTTP_UNAUTH; break;
case ENOMEM: fatal = 1; ret = HTTP_INTERNAL; break;
default: ret = HTTP_INTERNAL; break;
break;
case ENOENT: ret = HTTP_NOTFOUND; break;
case EPERM: ret = HTTP_UNAUTH; break;
+ case EIDRM: ret = HTTP_GONE; break;
case EDG_WLL_ERROR_NOINDEX: ret = HTTP_UNAVAIL; break;
default: ret = HTTP_INTERNAL; break;
}
case ENOENT: ret = HTTP_NOTFOUND; break;
case EINVAL: ret = HTTP_INVALID; break;
case EPERM : ret = HTTP_UNAUTH; break;
+ case EIDRM : ret = HTTP_GONE; break;
default: ret = HTTP_INTERNAL; break;
}
if (!html && (ret != HTTP_INTERNAL))
case EINVAL: ret = HTTP_UNAUTH; break;
case EDG_WLL_ERROR_NOINDEX: ret = HTTP_UNAUTH; break;
case ENOMEM: fatal = 1; ret = HTTP_INTERNAL; break;
+ case EIDRM: ret = HTTP_GONE; break;
default: ret = HTTP_INTERNAL; break;
}
if (!html && !fatal)
j = 0,
ret = 0,
eperm = 0,
+ eidrm = 0,
limit = 0, offset = 0,
limit_loop = 1,
where_flags = 0,
LOG_PRIORITY_DEBUG, zquery);
j = edg_wll_ExecSQL(ctx,zquery,&sh);
- if (j > 0) {
- n = 0;
- while ( (ret=edg_wll_FetchRow(ctx,sh,sizofa(res),NULL,res)) > 0 ) {
- edg_wlc_JobIdParse(res[0], &jobid);
- edg_wlc_JobIdParse(res[0], &status.jobId);
- status.state = EDG_WLL_JOB_PURGED;
- free(res[0]); free(res[1]); free(res[2]);
- if (cb(ctx, jobid, &status, data) != 0)
- goto cleanup;
- n++;
- }
- }
+ if (j > 0) eidrm = 1;
+
glite_lbu_FreeStmt(&sh);
+ free (zquery);
}
}
if ( !n ) {
if (eperm) edg_wll_SetError(ctx, EPERM, "matching jobs found but authorization failed");
- else edg_wll_SetError(ctx, ENOENT, "no matching jobs found");
+ else {
+ if (eidrm) edg_wll_SetError(ctx, EIDRM, "matching job already purged");
+ else edg_wll_SetError(ctx, ENOENT, "no matching jobs found");
+ }
}
// finish