Skip to content

Commit 61a75b3

Browse files
committed
remove unused code
1 parent 2c4db09 commit 61a75b3

5 files changed

Lines changed: 1 addition & 23 deletions

File tree

include/proxy/http/remap/NextHopSelectionStrategy.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ class NextHopSelectionStrategy
198198
const time_t now = 0);
199199
bool nextHopExists(TSHttpTxn txnp, void *ih = nullptr);
200200

201-
void setHostHeader(TSHttpTxn txnp, const char *hostname);
202-
203201
virtual ParentRetry_t responseIsRetryable(int64_t sm_id, HttpTransact::CurrentInfo &current_info, HTTPStatus response_code);
204202

205203
void retryComplete(TSHttpTxn txn, const char *hostname, const int port);

src/proxy/http/HttpTransact.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@ find_server_and_update_current_info(HttpTransact::State *s)
701701
702702
if (s->parent_result.result == ParentResultType::SPECIFIED && host_override(s)) {
703703
char const *const hostname = s->parent_result.hostname;
704+
TxnDbg(dbg_ctl_http_trans, "overriding host header with parent %s", hostname);
704705
if (!s->hdr_info.server_request.valid()) {
705706
s->hdr_info.client_request.value_set(static_cast<std::string_view>(MIME_FIELD_HOST), hostname);
706707
s->hdr_info.client_request.mark_target_dirty();

src/proxy/http/remap/NextHopConsistentHash.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,4 @@ NextHopConsistentHash::findNextHop(TSHttpTxn txnp, void * /* ih ATS_UNUSED */, t
547547
NH_Dbg(NH_DBG_CTL, "[%" PRIu64 "] result.result: %s set hostname null port 0 retry false", sm_id,
548548
ParentResultStr[static_cast<int>(result.result)]);
549549
}
550-
551-
setHostHeader(txnp, result.hostname);
552-
553-
return;
554550
}

src/proxy/http/remap/NextHopRoundRobin.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ NextHopRoundRobin::findNextHop(TSHttpTxn txnp, void * /* ih ATS_UNUSED */, time_
170170
result->last_parent = cur_hst_index;
171171
result->last_group = cur_grp_index;
172172
result->retry = parentRetry;
173-
setHostHeader(txnp, result->hostname);
174173
ink_assert(result->hostname != nullptr);
175174
ink_assert(result->port != 0);
176175
NH_Dbg(NH_DBG_CTL, "[%" PRIu64 "] Chosen parent = %s.%d", sm_id, result->hostname, result->port);

src/proxy/http/remap/NextHopSelectionStrategy.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -265,22 +265,6 @@ NextHopSelectionStrategy::markNextHop(TSHttpTxn txnp, const char *hostname, cons
265265
return passive_health.markNextHop(txnp, hostname, port, status, ih, now);
266266
}
267267

268-
void
269-
NextHopSelectionStrategy::setHostHeader(TSHttpTxn txnp, const char *hostname)
270-
{
271-
if (host_override && nullptr != hostname) {
272-
HttpSM *const sm = reinterpret_cast<HttpSM *>(txnp);
273-
if (!sm->t_state.hdr_info.server_request.valid()) {
274-
sm->t_state.hdr_info.client_request.value_set(static_cast<std::string_view>(MIME_FIELD_HOST), hostname);
275-
sm->t_state.hdr_info.client_request.mark_target_dirty();
276-
} else {
277-
sm->t_state.hdr_info.server_request.value_set(static_cast<std::string_view>(MIME_FIELD_HOST), hostname);
278-
sm->t_state.hdr_info.server_request.mark_target_dirty();
279-
}
280-
NH_Dbg(NH_DBG_CTL, "[%" PRIu64 "] overriding host header with parent %s", sm->sm_id, hostname);
281-
}
282-
}
283-
284268
bool
285269
NextHopSelectionStrategy::nextHopExists(TSHttpTxn txnp, void * /* ih ATS_UNUSED */)
286270
{

0 commit comments

Comments
 (0)