mirror of
https://github.com/emqx/neuron.git
synced 2026-10-17 04:40:42 +08:00
@@ -37,7 +37,7 @@ void handle_add_adapter(nng_aio *aio)
|
||||
|
||||
REST_PROCESS_HTTP_REQUEST_VALIDATE_JWT(
|
||||
aio, neu_json_add_node_req_t, neu_json_decode_add_node_req, {
|
||||
if (strlen(req->name) > NEU_NODE_NAME_LEN) {
|
||||
if (strlen(req->name) >= NEU_NODE_NAME_LEN) {
|
||||
NEU_JSON_RESPONSE_ERROR(NEU_ERR_NODE_NAME_TOO_LONG, {
|
||||
http_response(aio, NEU_ERR_NODE_NAME_TOO_LONG,
|
||||
result_error);
|
||||
|
||||
@@ -36,7 +36,7 @@ void handle_add_group_config(nng_aio *aio)
|
||||
REST_PROCESS_HTTP_REQUEST_VALIDATE_JWT(
|
||||
aio, neu_json_add_group_config_req_t,
|
||||
neu_json_decode_add_group_config_req, {
|
||||
if (strlen(req->group) > NEU_GROUP_NAME_LEN) {
|
||||
if (strlen(req->group) >= NEU_GROUP_NAME_LEN) {
|
||||
NEU_JSON_RESPONSE_ERROR(NEU_ERR_GROUP_NAME_TOO_LONG, {
|
||||
http_response(aio, NEU_ERR_GROUP_NAME_TOO_LONG,
|
||||
result_error);
|
||||
|
||||
@@ -506,11 +506,11 @@ int neu_adapter_driver_add_tag(neu_adapter_driver_t *driver, const char *group,
|
||||
return NEU_ERR_TAG_NAME_TOO_LONG;
|
||||
}
|
||||
|
||||
if (strlen(tag->address) > NEU_TAG_ADDRESS_LEN) {
|
||||
if (strlen(tag->address) >= NEU_TAG_ADDRESS_LEN) {
|
||||
return NEU_ERR_TAG_ADDRESS_TOO_LONG;
|
||||
}
|
||||
|
||||
if (strlen(tag->description) > NEU_TAG_DESCRIPTION_LEN) {
|
||||
if (strlen(tag->description) >= NEU_TAG_DESCRIPTION_LEN) {
|
||||
return NEU_ERR_TAG_DESCRIPTION_TOO_LONG;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user