const char *host,
const uint16_t port,
const char *owner,
+ int expires,
const char *notif_data,
char **ulm_data,
char **reg_id_s)
event->notification.dest_port = port;
if (notif_data) event->notification.jobstat = strdup(notif_data);
+ event->notification.expires = expires;
+
if ((*ulm_data = edg_wll_UnparseNotifEvent(context,event)) == NULL) {
edg_wll_SetError(context, ret = ENOMEM, "edg_wll_UnparseNotifEvent()");
goto out;
const char *host,
int port,
const char *owner,
+ int expires,
const char *notif_data)
{
struct timeval timeout = {NOTIF_TIMEOUT, 0};
host,
port,
owner,
+ expires,
notif_data,
&ulm_data,
®_id_s))) {
const char *host,
int port,
const char *owner,
+ int expires,
const edg_wll_JobStat notif_job_stat)
{
int ret=0;
goto out;
}
- if (ret=edg_wll_NotifSend(context, reg_id, host, port, owner, xml_esc_data)) {
+ if ((ret=edg_wll_NotifSend(context, reg_id, host, port, owner, expires, xml_esc_data))) {
char *ed = NULL, *et = NULL;
if(ret) edg_wll_UpdateError(context, ret, "edg_wll_NotifJobStatus()");
int
-edg_wll_NotifChangeDestination(edg_wll_Context context,
+edg_wll_NotifChangeIL(edg_wll_Context context,
edg_wll_NotifId reg_id,
const char *host,
- int port)
+ int port,
+ int expires)
{
- return(edg_wll_NotifSend(context, reg_id, host, port, "", ""));
+ return(edg_wll_NotifSend(context, reg_id, host, port, "", expires, ""));
}
edg_wll_NotifCancelRegId(edg_wll_Context context,
edg_wll_NotifId reg_id)
{
- return(edg_wll_NotifSend(context, reg_id, NULL, 0, "", ""));
+ return(edg_wll_NotifSend(context, reg_id, NULL, 0, "", 0, ""));
}
const char *host,
int port,
const char *owner,
+ int expires,
const char *notif_data);
const char *host,
int port,
const char *owner,
+ int expires,
const edg_wll_JobStat notif_job_stat);
* \see edg_wll_NotifSend()
*/
int
-edg_wll_NotifChangeDestination(edg_wll_Context context,
+edg_wll_NotifChangeIL(edg_wll_Context context,
edg_wll_NotifId reg_id,
const char *host,
- int port);
+ int port,
+ int expires);
/** Cancel registration.
* Creates ULM string and uses edg_wll_NotifSend() to pass it to
edg_wll_NotifId nid = NULL;
char *jobq,*ju = NULL,*jobc[5];
edg_wll_Stmt jobs = NULL;
- int ret,i;
+ int ret,i,expires;
time_t now = time(NULL);
edg_wll_ResetError(ctx);
if (edg_wll_ExecStmt(ctx,jobq,&jobs) < 0) goto err;
while ((ret = edg_wll_FetchRow(jobs,jobc)) > 0) {
- if (now > edg_wll_DBToTime(jobc[2]))
+ if (now > (expires = edg_wll_DBToTime(jobc[2])))
edg_wll_NotifExpired(ctx,jobc[0]);
else if (notif_match_conditions(ctx,stat,jobc[4]) &&
notif_check_acl(ctx,stat,jobc[3]))
/* XXX: only temporary hack!!!
*/
ctx->p_instance = strdup("");
- if ( edg_wll_NotifJobStatus(ctx, nid, dest, port, jobc[3], *stat) )
+ if ( edg_wll_NotifJobStatus(ctx, nid, dest, port, jobc[3], expires, *stat) )
{
free(dest);
for (i=0; i<sizeof(jobc)/sizeof(jobc[0]); i++) free(jobc[i]);
*/
}
- if ( host ) {
- printf("edg_wll_NotifChangeDestination(ctx, %s, %s, %d)\n",
+ if ( host || valid) {
+ char *v = strdup(valid),*v2 = strchr(v+1,'\'');
+ int expires;
+
+ *v2 = 0;
+ expires = edg_wll_DBToTime(v+1);
+/*
+ printf("edg_wll_NotifChangeIL(ctx, %s, %s, %d)\n",
nid_s? nid_s: "nid", host, port);
- if ( edg_wll_NotifChangeDestination(ctx, nid, host, port) ) {
+*/
+ if ( edg_wll_NotifChangeIL(ctx, nid, host, port, expires) ) {
char *errt, *errd;
edg_wll_Error(ctx, &errt, &errd);
- printf("edg_wll_NotifChangeDestination(): %s (%s)\n", errt, errd);
+ fprintf(stderr,"edg_wll_NotifChangeIL(): %s (%s)\n", errt, errd);
free(errt);
free(errd);
}
+ free(v);
}