Skip to content

Commit

Permalink
Merge pull request #1765 from hxy7yx/v2.7-1
Browse files Browse the repository at this point in the history
fix(add_gtags):license tag count
  • Loading branch information
fengzeroz authored Dec 19, 2023
2 parents 7a26755 + bbe7a30 commit 04bc0f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/adapter/adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,6 @@ int add_gtags(neu_adapter_t *adapter, neu_req_add_gtag_t *cmd,
cmd->groups[group_index].group,
&cmd->groups[group_index].tags[tag_index],
cmd->groups[group_index].interval);

if (add_tag_result != 0) {
for (int added_group_index = 0; added_group_index < group_index;
added_group_index++) {
Expand All @@ -1298,6 +1297,12 @@ int add_gtags(neu_adapter_t *adapter, neu_req_add_gtag_t *cmd,
cmd->groups[group_index].group,
cmd->groups[group_index].tags[added_tag_index].name);
}
for (int groups_count = 0; groups_count < cmd->n_group;
groups_count++) {
neu_adapter_driver_try_del_tag(
(neu_adapter_driver_t *) adapter,
cmd->groups[groups_count].n_tag);
}
resp->index = 0;
resp->error = add_tag_result;
return add_tag_result;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ int neu_http_response(nng_aio *aio, neu_err_code_e code, char *content)
case NEU_ERR_LICENSE_EXPIRED:
case NEU_ERR_LICENSE_DISABLED:
case NEU_ERR_LICENSE_MAX_NODES:
case NEU_ERR_LICENSE_MAX_TAGS:
case NEU_ERR_LICENSE_TOKEN_NOT_MATCH:
case NEU_ERR_GROUP_ALREADY_SUBSCRIBED:
case NEU_ERR_PLUGIN_TAG_TYPE_MISMATCH:
Expand Down Expand Up @@ -355,6 +354,7 @@ int neu_http_response(nng_aio *aio, neu_err_code_e code, char *content)
case NEU_ERR_TAG_PRECISION_INVALID:
case NEU_ERR_TAG_NAME_TOO_LONG:
case NEU_ERR_TAG_ADDRESS_TOO_LONG:
case NEU_ERR_LICENSE_MAX_TAGS:
case NEU_ERR_LICENSE_BAD_CLOCK:
case NEU_ERR_LICENSE_MODULE_INVALID:
status = NNG_HTTP_STATUS_BAD_REQUEST;
Expand Down

0 comments on commit 04bc0f0

Please sign in to comment.