Skip to content

Commit

Permalink
address zuercher and lizan's comment
Browse files Browse the repository at this point in the history
Signed-off-by: kuochunghsu <[email protected]>
  • Loading branch information
kuochunghsu committed Oct 24, 2022
1 parent abf1d1b commit 619390d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ package envoy.extensions.filters.network.thrift_proxy.filters.payload_to_metadat

import "envoy/type/matcher/v3/regex.proto";

import "google/protobuf/wrappers.proto";

import "udpa/annotations/status.proto";
import "validate/validate.proto";

Expand Down Expand Up @@ -90,11 +88,8 @@ message PayloadToMetadata {
// field name to log
string name = 1 [(validate.rules).string = {min_len: 1}];

// field id to match. Limit to the range of int16 to fit thrift format.
google.protobuf.Int32Value id = 2 [
(validate.rules).int32 = {lte: 32767 gte: -32768},
(validate.rules).message = {required: true}
];
// field id to match
int32 id = 2 [(validate.rules).int32 = {lte: 32767 gte: -32768}];

// next node of the field selector
FieldSelector child = 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Rule::Rule(const ProtoRule& rule, uint16_t rule_id, TrieSharedPtr root)
const FieldSelector* field_selector = &rule_.field_selector();
TrieSharedPtr node = root;
while (true) {
int16_t id = static_cast<int16_t>(field_selector->id().value());
int16_t id = static_cast<int16_t>(field_selector->id());
if (node->children_.find(id) == node->children_.end()) {
node->children_[id] = std::make_shared<Trie>(node);
}
Expand Down

0 comments on commit 619390d

Please sign in to comment.