Copilot commented on code in PR #13287:
URL: https://github.com/apache/trafficserver/pull/13287#discussion_r3447664260
##########
plugins/compress/compress.cc:
##########
@@ -349,6 +350,16 @@ compress_transform_init(TSCont contp, Data *data)
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
}
+static ts::Metrics::Counter::AtomicType *compress_stat_bytes_in = nullptr;
+
+static void
+init_compress_stats()
+{
+ if (compress_stat_bytes_in == nullptr) {
+ compress_stat_bytes_in =
ts::Metrics::Counter::createPtr("proxy.process.plugin.compress.bytes_in");
+ }
+}
+
static void
compress_transform_one(Data *data, TSIOBufferReader upstream_reader, int
amount)
Review Comment:
`compress_transform_one()` takes `int amount`, but its caller passes an
`int64_t` byte count (`upstream_todo`). This can truncate large bodies (or flip
negative) and lead to incorrect processing and metric accounting. Use `int64_t`
for the `amount` parameter to match the VIO byte counters used elsewhere in
this transform.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]