From db15f821d7929293e2cdc4e4e0eaeb5cd6bab801 Mon Sep 17 00:00:00 2001 From: Vijay Mamidi Date: Thu, 25 May 2017 12:01:26 -0700 Subject: [PATCH] Server information should be cleared when following redirect --- proxy/http/HttpSM.cc | 2 ++ proxy/http/HttpTransact.h | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 52a0e498244..aae29614b1f 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -7694,6 +7694,8 @@ HttpSM::redirect_request(const char *redirect_url, const int redirect_len) // we have a new OS and need to have DNS lookup the new OS t_state.dns_info.lookup_success = false; t_state.force_dns = false; + t_state.server_info.clear(); + t_state.parent_info.clear(); if (t_state.txn_conf->cache_http) { t_state.cache_info.object_read = nullptr; diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h index f47fbcf7bcf..338bcd8cb76 100644 --- a/proxy/http/HttpTransact.h +++ b/proxy/http/HttpTransact.h @@ -637,10 +637,14 @@ class HttpTransact connect_result = e; } - ConnectionAttributes() + ConnectionAttributes() { clear(); } + + void + clear() { - memset(&src_addr, 0, sizeof(src_addr)); - memset(&dst_addr, 0, sizeof(dst_addr)); + ink_zero(src_addr); + ink_zero(dst_addr); + connect_result = 0; } };