Copilot commented on code in PR #13004:
URL: https://github.com/apache/trafficserver/pull/13004#discussion_r2963403517
##########
include/proxy/http/HttpVCTable.h:
##########
@@ -41,17 +41,17 @@ enum class HttpVC_t {
};
struct HttpVCTableEntry {
- VConnection *vc;
- MIOBuffer *read_buffer;
- MIOBuffer *write_buffer;
- VIO *read_vio;
- VIO *write_vio;
- HttpSMHandler vc_read_handler;
- HttpSMHandler vc_write_handler;
- HttpVC_t vc_type;
- HttpSM *sm;
- bool eos;
- bool in_tunnel;
+ VConnection *vc{nullptr};
+ MIOBuffer *read_buffer{nullptr};
+ MIOBuffer *write_buffer{nullptr};
+ VIO *read_vio{nullptr};
+ VIO *write_vio{nullptr};
+ HttpSMHandler vc_read_handler{};
+ HttpSMHandler vc_write_handler{};
+ HttpVC_t vc_type{HttpVC_t::UNKNOWN};
+ HttpSM *sm{nullptr};
Review Comment:
`HttpVCTableEntry` is now safely value-initialized here, but
`HttpVCTable::HttpVCTable()` currently `memset`s `vc_table` to zero
(src/proxy/http/HttpVCTable.cc:35), which overwrites these defaults and also
relies on all-bits-zero being a valid null representation for member-function
pointers (`HttpSMHandler`). Consider removing the `memset` and instead
value-initializing/clearing entries via normal C++ initialization (e.g.,
`vc_table{}` / per-entry reset) so the table uses the same well-defined
initialization as this struct.
--
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]