Skip to content

Commit 8e6b509

Browse files
authored
Remove unused member variables across multiple subsystems (#13005)
Remove unused member variables and dead code identified by static analysis across core, cache, net, proxy, and plugin subsystems. * Event.h: drop dead #ifdef ONLY_USED_FOR_FIB_AND_BIN_HEAP block. * HttpSM: remove unused m_last_state, prev_hook_start_time, cur_hooks. * CacheVC: reorder fields; rename unused open_read_timeout flag. * AIO / ink_aiocb: remove unused aio_state, aio__pad[1], and index. These were cargo-culted from POSIX struct aiocb; ink_aiocb is internal to ATS and never crosses an ABI boundary. * LogBuffer: remove unused m_in_network_order and simplify iterator. * Http1{Client,Server}Transaction: remove unused outbound_transparent. * ConnectingEntry: remove unused NetVCOptions opt field. * ParentConsistentHash: remove unused foundParents member. * SSLNetVConnection: remove unused protocol_mask_set and protocol_mask (unrelated to the TLSValidProtocols mask used by SNI config).
1 parent 395bbaf commit 8e6b509

15 files changed

Lines changed: 29 additions & 76 deletions

File tree

include/iocore/aio/AIO.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ struct ink_aiocb {
5858
off_t aio_offset = 0; /* file offset */
5959

6060
int aio_lio_opcode = 0; /* listio operation */
61-
int aio_state = 0; /* state flag for List I/O */
6261
};
6362

6463
bool ink_aio_thread_num_set(int thread_num);

include/iocore/eventsystem/Event.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -267,20 +267,6 @@ class Event : public Action
267267
| UNIX/non-NT Interface |
268268
\*-------------------------------------------------------*/
269269

270-
#ifdef ONLY_USED_FOR_FIB_AND_BIN_HEAP
271-
void *node_pointer;
272-
void
273-
set_node_pointer(void *x)
274-
{
275-
node_pointer = x;
276-
}
277-
void *
278-
get_node_pointer()
279-
{
280-
return node_pointer;
281-
}
282-
#endif
283-
284270
#if defined(__GNUC__)
285271
~Event() override {}
286272
#endif

include/proxy/ParentConsistentHash.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class ParentConsistentHash : public ParentSelectionStrategy
4141
std::unique_ptr<ATSHash64> hash[2];
4242
std::unique_ptr<ATSConsistentHash> chash[2];
4343
pRecord *parents[2];
44-
bool foundParents[2][MAX_PARENTS];
4544
bool ignore_query;
4645
int secondary_mode;
4746
ParentHashAlgorithm selected_algorithm;

include/proxy/http/ConnectingEntry.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class ConnectingEntry : public Continuation
5454
MIOBuffer *_netvc_read_buffer = nullptr;
5555
IOBufferReader *_netvc_reader = nullptr;
5656
Action *_pending_action = nullptr;
57-
NetVCOptions opt;
5857
};
5958

6059
struct IpHelper {

include/proxy/http/Http1ClientTransaction.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,4 @@ class Http1ClientTransaction : public Http1Transaction
4141
void transaction_done() override;
4242
void increment_transactions_stat() override;
4343
void decrement_transactions_stat() override;
44-
45-
////////////////////
46-
// Variables
47-
48-
protected:
49-
bool outbound_transparent{false};
5044
};

include/proxy/http/Http1ServerTransaction.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,4 @@ class Http1ServerTransaction : public Http1Transaction
4444
void transaction_done() override;
4545

4646
void force_close();
47-
48-
////////////////////
49-
// Variables
50-
51-
protected:
52-
bool outbound_transparent{false};
5347
};

include/proxy/http/HttpSM.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,9 @@ class HttpSM : public Continuation, public PluginUserArgs<TS_USER_ARGS_TXN>
483483
*/
484484
void setup_client_request_plugin_agents(HttpTunnelProducer *p, int num_header_bytes = 0);
485485

486-
HttpTransact::StateMachineAction_t last_action = HttpTransact::StateMachineAction_t::UNDEFINED;
487-
int (HttpSM::*m_last_state)(int event, void *data) = nullptr;
488-
virtual void set_next_state();
489-
void call_transact_and_set_next_state(TransactEntryFunc_t f);
486+
HttpTransact::StateMachineAction_t last_action = HttpTransact::StateMachineAction_t::UNDEFINED;
487+
virtual void set_next_state();
488+
void call_transact_and_set_next_state(TransactEntryFunc_t f);
490489

491490
bool is_http_server_eos_truncation(HttpTunnelProducer *);
492491
bool is_bg_fill_necessary(HttpTunnelConsumer *c);
@@ -564,11 +563,7 @@ class HttpSM : public Continuation, public PluginUserArgs<TS_USER_ARGS_TXN>
564563
APIHook const *cur_hook = nullptr;
565564
HttpHookState hook_state;
566565

567-
// Continuation time keeper
568-
int64_t prev_hook_start_time = 0;
569-
570566
int reentrancy_count = 0;
571-
int cur_hooks = 0;
572567
HttpApiState_t callout_state = HttpApiState_t::NO_CALLOUT;
573568

574569
// api_hooks must not be changed directly

include/proxy/logging/LogBuffer.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ class LogBufferList
284284
class LogBufferIterator
285285
{
286286
public:
287-
LogBufferIterator(LogBufferHeader *header, bool in_network_order = false);
287+
LogBufferIterator(LogBufferHeader *header);
288288
~LogBufferIterator();
289289

290290
LogEntryHeader *next();
@@ -295,7 +295,6 @@ class LogBufferIterator
295295
LogBufferIterator &operator=(const LogBufferIterator &) = delete;
296296

297297
private:
298-
bool m_in_network_order;
299298
char *m_next;
300299
unsigned m_iter_entry_count;
301300
unsigned m_buffer_entry_count;
@@ -311,8 +310,8 @@ class LogBufferIterator
311310
within a given LogBuffer.
312311
-------------------------------------------------------------------------*/
313312

314-
inline LogBufferIterator::LogBufferIterator(LogBufferHeader *header, bool in_network_order)
315-
: m_in_network_order(in_network_order), m_next(nullptr), m_iter_entry_count(0), m_buffer_entry_count(0)
313+
inline LogBufferIterator::LogBufferIterator(LogBufferHeader *header)
314+
: m_next(nullptr), m_iter_entry_count(0), m_buffer_entry_count(0)
316315
{
317316
ink_assert(header);
318317

include/tscore/ink_aiocb.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,4 @@ struct ink_aiocb {
4949
off_t aio_offset; /* file offset */
5050

5151
int aio_lio_opcode; /* listio operation */
52-
int aio_state; /* state flag for List I/O */
53-
int aio__pad[1]; /* extension padding */
5452
};

src/iocore/aio/AIO.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ struct AIO_Reqs {
112112
ASLL(AIOCallback, alink) aio_temp_list;
113113
ink_mutex aio_mutex;
114114
ink_cond aio_cond;
115-
int index = 0; /* position of this struct in the aio_reqs array */
116115
int pending = 0; /* number of outstanding requests on the disk */
117116
int queued = 0; /* total number of aio_todo requests */
118117
int filedes = -1; /* the file descriptor for the requests or status IO_NOT_IN_PROGRESS */
@@ -301,13 +300,11 @@ aio_init_fildes(int fildes, int fromAPI = 0)
301300
RecInt thread_num;
302301

303302
if (fromAPI) {
304-
request->index = 0;
305303
request->filedes = -1;
306304
aio_reqs[0] = request;
307305
thread_is_created = 1;
308306
thread_num = api_config_threads_per_disk;
309307
} else {
310-
request->index = num_filedes;
311308
request->filedes = fildes;
312309
aio_reqs[num_filedes] = request;
313310
thread_num = cache_config_threads_per_disk;

0 commit comments

Comments
 (0)