bbfdmd: complete deferred requests when async invoke setup fails

This commit is contained in:
Xiaofeng Meng 2026-03-09 11:40:18 +00:00 committed by IOPSYS Dev
parent 12228596e3
commit e812df49fa
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -350,12 +350,13 @@ static int bbfdm_handler_async(struct ubus_context *ctx, struct ubus_object *obj
if (!service_path_match(context->requested_path, requested_proto, service))
continue;
context->path_matched = true;
run_async_call(context, service, msg);
}
context->service_list_processed = true;
if (context->path_matched == false)
if (context->pending_requests == 0)
send_response(context);
return 0;

View file

@ -194,8 +194,6 @@ void run_async_call(struct async_request_context *ctx, service_entry_t *service,
tracker->ctx = ctx;
tracker->service = service;
ctx->pending_requests++;
ctx->path_matched = true;
memset(&req_buf, 0, sizeof(struct blob_buf));
blob_buf_init(&req_buf, 0);
@ -220,6 +218,7 @@ void run_async_call(struct async_request_context *ctx, service_entry_t *service,
uloop_timeout_cancel(&tracker->timeout);
BBFDM_FREE(tracker);
} else {
ctx->pending_requests++;
tracker->async_request.data_cb = ubus_result_callback;
tracker->async_request.complete_cb = ubus_request_complete;
ubus_complete_request_async(ctx->ubus_ctx, &tracker->async_request);