summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-08-25 12:38:47 +0200
committerVolker Lendecke <vl@samba.org>2009-08-29 19:42:26 +0200
commit9ef2c7096341f849bd1b52bf92e01936c3869eee (patch)
treeb72ddbc0b7e2349cee6c19f4d59bc2c1c19e2e2c
parentae6a6690d5ed55935c1fa0ad2800d83455c94382 (diff)
downloadsamba-9ef2c7096341f849bd1b52bf92e01936c3869eee.tar.gz
samba-9ef2c7096341f849bd1b52bf92e01936c3869eee.tar.bz2
samba-9ef2c7096341f849bd1b52bf92e01936c3869eee.zip
s3:winbind: simplify wb_seqnums_done a bit
-rw-r--r--source3/winbindd/wb_seqnums.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/source3/winbindd/wb_seqnums.c b/source3/winbindd/wb_seqnums.c
index e6efb9b99a..604ba00505 100644
--- a/source3/winbindd/wb_seqnums.c
+++ b/source3/winbindd/wb_seqnums.c
@@ -98,24 +98,33 @@ static void wb_seqnums_done(struct tevent_req *subreq)
for (i=0; i<state->num_domains; i++) {
if (subreq == state->subreqs[i]) {
- state->subreqs[i] = NULL;
- state->stati[i] = status;
- if (NT_STATUS_IS_OK(status)) {
- state->seqnums[i] = seqnum;
-
- /*
- * This first assignment might be removed
- * later
- */
- state->domains[i]->sequence_number = seqnum;
-
- wcache_store_seqnum(state->domains[i]->name,
- state->seqnums[i],
- time(NULL));
- }
break;
}
}
+ if (i < state->num_domains) {
+ /* found one */
+
+ state->subreqs[i] = NULL;
+ state->stati[i] = status;
+ if (NT_STATUS_IS_OK(status)) {
+ state->seqnums[i] = seqnum;
+
+ /*
+ * This first assignment might be removed
+ * later
+ */
+ state->domains[i]->sequence_number = seqnum;
+
+ if (!wcache_store_seqnum(state->domains[i]->name,
+ state->seqnums[i],
+ time(NULL))) {
+ DEBUG(1, ("wcache_store_seqnum failed for "
+ "domain %s\n",
+ state->domains[i]->name));
+ }
+ }
+ }
+
TALLOC_FREE(subreq);
state->num_received += 1;