diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-01 12:20:08 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-01 10:38:47 +0200 |
commit | c29069e079018853867d643b8de604edd95c94d9 (patch) | |
tree | 179791a97ea4e9087958f22b07ea39660a285ed8 | |
parent | 0204ae6229bae3573b3194c3f657c8f385c0b940 (diff) | |
download | samba-c29069e079018853867d643b8de604edd95c94d9.tar.gz samba-c29069e079018853867d643b8de604edd95c94d9.tar.bz2 samba-c29069e079018853867d643b8de604edd95c94d9.zip |
libcli/cldap/cldap.c: don't hand huge values to tevent_timeval_add usecs
state->request.delay is two million here, resulting in an invalid timeval.
Since tevent doesn't have a convenient wrapper to add arbitrary usecs,
do the arithmetic here (it's the sole caller of this function).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | libcli/cldap/cldap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c index f5585c2b73..37b4f4913d 100644 --- a/libcli/cldap/cldap.c +++ b/libcli/cldap/cldap.c @@ -626,7 +626,8 @@ struct tevent_req *cldap_search_send(TALLOC_CTX *mem_ctx, now = tevent_timeval_current(); end = now; for (i = 0; i < state->request.count; i++) { - end = tevent_timeval_add(&end, 0, state->request.delay); + end = tevent_timeval_add(&end, state->request.delay / 1000000, + state->request.delay % 1000000); } if (!tevent_req_set_endtime(req, state->caller.cldap->event.ctx, end)) { @@ -688,7 +689,8 @@ static void cldap_search_state_queue_done(struct tevent_req *subreq) return; } - next = tevent_timeval_current_ofs(0, state->request.delay); + next = tevent_timeval_current_ofs(state->request.delay / 1000000, + state->request.delay % 1000000); subreq = tevent_wakeup_send(state, state->caller.cldap->event.ctx, next); |