summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2009-03-10 10:05:52 -0400
committerSimo Sorce <idra@samba.org>2009-03-10 11:08:53 -0400
commit97cccb22194380ce84bf6188df90e2438f1176db (patch)
tree3d7135966d703ea2c2d8d7f90db54ab6c750e76d /source4/lib/ldb
parent9579a6f193f570e4ce2af80f4aac7c2f25ae5b22 (diff)
downloadsamba-97cccb22194380ce84bf6188df90e2438f1176db.tar.gz
samba-97cccb22194380ce84bf6188df90e2438f1176db.tar.bz2
samba-97cccb22194380ce84bf6188df90e2438f1176db.zip
Fix extended operation return path.
Extended operations return was not going thorugh the same patch as others leaving the ctx around. Plus we were neutralizing the spy too early so that it didn't set the request_terminated flag as it should have. This should hopefully fix the failures in the build farm.
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index d38cb828bb..9df62be936 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -1020,13 +1020,14 @@ static void ltdb_timeout(struct tevent_context *ev,
ctx = talloc_get_type(private_data, struct ltdb_context);
if (!ctx->request_terminated) {
- /* neutralize the spy */
- ctx->spy->ctx = NULL;
-
/* request is done now */
ltdb_request_done(ctx, LDB_ERR_TIME_LIMIT_EXCEEDED);
}
+ if (!ctx->request_terminated) {
+ /* neutralize the spy */
+ ctx->spy->ctx = NULL;
+ }
talloc_free(ctx);
}
@@ -1086,10 +1087,9 @@ static void ltdb_callback(struct tevent_context *ev,
ctx = talloc_get_type(private_data, struct ltdb_context);
- if (!ctx->request_terminated) {
- /* neutralize the spy */
- ctx->spy->ctx = NULL;
- } else goto done;
+ if (ctx->request_terminated) {
+ goto done;
+ }
switch (ctx->req->operation) {
case LDB_SEARCH:
@@ -1109,7 +1109,7 @@ static void ltdb_callback(struct tevent_context *ev,
break;
case LDB_EXTENDED:
ltdb_handle_extended(ctx);
- return;
+ goto done;
default:
/* no other op supported */
ret = LDB_ERR_UNWILLING_TO_PERFORM;
@@ -1121,6 +1121,10 @@ static void ltdb_callback(struct tevent_context *ev,
}
done:
+ if (!ctx->request_terminated) {
+ /* neutralize the spy */
+ ctx->spy->ctx = NULL;
+ }
talloc_free(ctx);
}