From 98dfb6601c523f398e3bc316716ffcb0a45a55f6 Mon Sep 17 00:00:00 2001 From: "xiang.zhou" Date: Mon, 9 Feb 2026 13:34:40 +0800 Subject: [PATCH] update disconnect error status code and update scan node api --- plugins/restful/scan_handle.c | 2 +- src/utils/http.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/restful/scan_handle.c b/plugins/restful/scan_handle.c index 2d89315de..063a39032 100644 --- a/plugins/restful/scan_handle.c +++ b/plugins/restful/scan_handle.c @@ -73,6 +73,6 @@ void handle_scan_tags_resp(nng_aio *aio, neu_resp_scan_tags_t *resp) { char *result = NULL; neu_json_encode_by_fn(resp, neu_json_encode_scan_tags_resp, &result); - neu_http_ok(aio, result); + neu_http_response(aio, resp->error, result); free(result); } diff --git a/src/utils/http.c b/src/utils/http.c index 02edae23f..88970968d 100644 --- a/src/utils/http.c +++ b/src/utils/http.c @@ -248,7 +248,6 @@ int neu_http_response(nng_aio *aio, neu_err_code_e code, char *content) case NEU_ERR_NODE_SETTING_NOT_FOUND: case NEU_ERR_PLUGIN_READ_FAILURE: case NEU_ERR_PLUGIN_WRITE_FAILURE: - case NEU_ERR_PLUGIN_DISCONNECTED: case NEU_ERR_PLUGIN_TAG_NOT_ALLOW_READ: case NEU_ERR_PLUGIN_TAG_NOT_ALLOW_WRITE: case NEU_ERR_LICENSE_EXPIRED: @@ -343,6 +342,7 @@ int neu_http_response(nng_aio *aio, neu_err_code_e code, char *content) case NEU_ERR_NODE_TAGS_TOO_MANY: case NEU_ERR_NODE_TAGS_INVALID: case NEU_ERR_NODE_TAGS_TOO_LONG: + case NEU_ERR_PLUGIN_DISCONNECTED: status = NNG_HTTP_STATUS_BAD_REQUEST; break; case NEU_ERR_FILE_NOT_EXIST: