dav_lock_walker: Walker callback function to record indirect locks */
| 258 | |
| 259 | /* dav_lock_walker: Walker callback function to record indirect locks */ |
| 260 | static dav_error * dav_lock_walker(dav_walk_resource *wres, int calltype) |
| 261 | { |
| 262 | dav_walker_ctx *ctx = wres->walk_ctx; |
| 263 | dav_error *err; |
| 264 | |
| 265 | /* We don't want to set indirects on the target */ |
| 266 | if ((*wres->resource->hooks->is_same_resource)(wres->resource, |
| 267 | ctx->w.root)) |
| 268 | return NULL; |
| 269 | |
| 270 | if ((err = (*ctx->w.lockdb->hooks->append_locks)(ctx->w.lockdb, |
| 271 | wres->resource, 1, |
| 272 | ctx->lock)) != NULL) { |
| 273 | if (ap_is_HTTP_SERVER_ERROR(err->status)) { |
| 274 | /* ### add a higher-level description? */ |
| 275 | return err; |
| 276 | } |
| 277 | |
| 278 | /* add to the multistatus response */ |
| 279 | dav_add_response(wres, err->status, NULL); |
| 280 | |
| 281 | /* |
| 282 | ** ### actually, this is probably wrong: we want to fail the whole |
| 283 | ** ### LOCK process if something goes bad. maybe the caller should |
| 284 | ** ### do a dav_unlock() (e.g. a rollback) if any errors occurred. |
| 285 | */ |
| 286 | } |
| 287 | |
| 288 | return NULL; |
| 289 | } |
| 290 | |
| 291 | /* |
| 292 | ** dav_add_lock: Add a direct lock for resource, and indirect locks for |
nothing calls this directly
no test coverage detected