Skip to content

Commit 8783778

Browse files
committed
proxylib: rename local variables
Rename 'ops' as 'op_slice' and 'ops_' as 'ops'. This helps reduce confusion with member variables that have the '_' suffix. Signed-off-by: Jarno Rajahalme <[email protected]>
1 parent 18ce5be commit 8783778

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

cilium/proxylib.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,15 @@ FilterResult GoFilter::Instance::onIo(bool reply, Buffer::Instance& data, bool e
196196
dir.need_bytes_ = 0;
197197

198198
const int max_ops = 16; // Make shorter for testing purposes
199-
FilterOp ops_[max_ops];
200-
GoFilterOpSlice ops(ops_, max_ops);
199+
FilterOp ops[max_ops];
200+
GoFilterOpSlice op_slice(ops, max_ops);
201201

202202
FilterResult res;
203203
bool terminal_op_seen = false;
204204
bool inject_buf_exhausted = false;
205205

206206
do {
207-
ops.reset();
207+
op_slice.reset();
208208
Buffer::RawSliceVector raw_slices = input.getRawSlices();
209209

210210
int64_t total_length = 0;
@@ -221,14 +221,14 @@ FilterResult GoFilter::Instance::onIo(bool reply, Buffer::Instance& data, bool e
221221

222222
ENVOY_CONN_LOG(trace, "Cilium Network::OnIO: Calling go module with {} bytes of data", conn_,
223223
total_length);
224-
res = (*parent_.go_on_data_)(connection_id_, reply, end_stream, &input_slices, &ops);
224+
res = (*parent_.go_on_data_)(connection_id_, reply, end_stream, &input_slices, &op_slice);
225225
ENVOY_CONN_LOG(trace, "Cilium Network::OnIO: \'go_on_data\' returned {}, ops({})", conn_,
226-
toString(res), ops.len());
226+
toString(res), op_slice.len());
227227
if (res == FILTER_OK) {
228228
// Process all returned filter operations.
229-
for (int i = 0; i < ops.len(); i++) {
230-
auto op = ops_[i].op;
231-
auto n_bytes = ops_[i].n_bytes;
229+
for (int i = 0; i < op_slice.len(); i++) {
230+
auto op = ops[i].op;
231+
auto n_bytes = ops[i].n_bytes;
232232

233233
if (n_bytes == 0) {
234234
ENVOY_CONN_LOG(warn, "Cilium Network::OnIO: INVALID op ({}) length: {} bytes", conn_, op,
@@ -317,7 +317,7 @@ FilterResult GoFilter::Instance::onIo(bool reply, Buffer::Instance& data, bool e
317317
dir.inject_slice_.reset();
318318

319319
// Loop back if ops or inject buffer was exhausted
320-
} while (!terminal_op_seen && (ops.len() == max_ops || inject_buf_exhausted));
320+
} while (!terminal_op_seen && (op_slice.len() == max_ops || inject_buf_exhausted));
321321

322322
if (output.length() < 100) {
323323
ENVOY_CONN_LOG(debug, "Cilium Network::OnIO: Output on return: {}", conn_, output.toString());

0 commit comments

Comments
 (0)