1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-19 18:50:24 +03:00

add a ifdeffed out block to the call.

we really should kill the event in case the call completed before the 
timeout   so that we can also make timed_out non-static

(This used to be ctdb commit f297eed589b1d4e188f77f195683365cf91d0e62)
This commit is contained in:
Ronnie Sahlberg 2007-05-06 07:32:16 +10:00
parent 4f2cdc2d8b
commit ad41dff7bf

View File

@ -679,6 +679,7 @@ int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid,
size_t len;
int ret;
static uint32_t timed_out;
struct timed_event *te=NULL;
/* if the domain socket is not yet open, open it */
if (ctdb->daemon.sd==-1) {
@ -722,7 +723,7 @@ int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid,
/* semi-async operation */
timed_out = 0;
if (timeout) {
event_add_timed(ctdb->ev, mem_ctx, *timeout, timeout_func, &timed_out);
te=event_add_timed(ctdb->ev, mem_ctx, *timeout, timeout_func, &timed_out);
}
while ((state->state == CTDB_CALL_WAIT)
&& (timed_out == 0) ){
@ -732,7 +733,13 @@ int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid,
talloc_free(state);
return -1;
}
#if 0
if ((timed_out==0) && te) {
/*why does this call here block forever?*/
talloc_free(te);
}
#endif
if (outdata) {
*outdata = state->outdata;
outdata->dptr = talloc_memdup(mem_ctx, outdata->dptr, outdata->dsize);