void (*chk_snd)(struct stream_interface *);/* chk_snd function */
int (*connect)(struct stream_interface *, struct proxy *, struct server *,
struct sockaddr *, struct sockaddr *); /* connect function if any */
+ void (*release)(struct stream_interface *); /* handler to call after the last close() */
void (*iohandler)(struct stream_interface *); /* internal I/O handler when embedded */
struct buffer *ib, *ob; /* input and output buffers */
int conn_retries; /* number of connect retries left */
s->si[0].err_loc = NULL;
s->si[0].connect = NULL;
s->si[0].iohandler = NULL;
+ s->si[0].release = NULL;
s->si[0].exp = TICK_ETERNITY;
s->si[0].flags = SI_FL_NONE;
s->si[1].err_loc = NULL;
s->si[1].connect = NULL;
s->si[1].iohandler = NULL;
+ s->si[1].release = NULL;
s->si[1].shutr = stream_int_shutr;
s->si[1].shutw = stream_int_shutw;
s->si[1].exp = TICK_ETERNITY;
si->flags &= ~SI_FL_CAP_SPLICE;
fd_delete(si->fd);
+ if (si->release)
+ si->release(si);
+
if (si->err_type)
return 0;
si->exp = TICK_ETERNITY;
}
+ if (si->release)
+ si->release(si);
+
/* note that if the task exist, it must unregister itself once it runs */
if (!(si->flags & SI_FL_DONT_WAKE) && si->owner)
task_wakeup(si->owner, TASK_WOKEN_IO);
si->exp = TICK_ETERNITY;
}
+ if (si->release)
+ si->release(si);
+
/* note that if the task exist, it must unregister itself once it runs */
if (!(si->flags & SI_FL_DONT_WAKE) && si->owner)
task_wakeup(si->owner, TASK_WOKEN_IO);
si->chk_snd = stream_int_chk_snd;
si->connect = NULL;
si->iohandler = fct;
+ si->release = NULL;
si->flags |= SI_FL_WAIT_DATA;
return si->owner;
}
si->chk_snd = stream_int_chk_snd;
si->connect = NULL;
si->iohandler = NULL; /* not used when running as an external task */
+ si->release = NULL;
si->flags |= SI_FL_WAIT_DATA;
t = task_new();
task_free(si->owner);
}
si->iohandler = NULL;
+ si->release = NULL;
si->owner = NULL;
}
si->exp = TICK_ETERNITY;
return;
}
+
+ if (si->release)
+ si->release(si);
}
/*
fd_delete(si->fd);
si->state = SI_ST_DIS;
si->exp = TICK_ETERNITY;
+
+ if (si->release)
+ si->release(si);
return;
}
EV_FD_CLR(si->fd, DIR_RD);