You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sh...@apache.org on 2019/02/13 14:06:21 UTC
[trafficserver] branch master updated: Remove header set for
uninitialized response.
This is an automated email from the ASF dual-hosted git repository.
shinrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 985894d Remove header set for uninitialized response.
985894d is described below
commit 985894ddae2377e3f0178d01e82948eb807987a5
Author: Susan Hinrichs <sh...@oath.com>
AuthorDate: Mon Feb 11 18:48:16 2019 +0000
Remove header set for uninitialized response.
---
proxy/http/HttpSM.cc | 8 ++++----
proxy/http/HttpSM.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index b2c9cb9..462febb 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -5592,7 +5592,7 @@ HttpSM::setup_transform_to_server_transfer()
}
void
-HttpSM::do_drain_request_body()
+HttpSM::do_drain_request_body(HTTPHdr &response)
{
int64_t content_length = t_state.hdr_info.client_request.get_content_length();
int64_t avail = ua_buffer_reader->read_avail();
@@ -5617,7 +5617,7 @@ HttpSM::do_drain_request_body()
close_connection:
t_state.client_info.keep_alive = HTTP_NO_KEEPALIVE;
- t_state.hdr_info.client_response.value_set(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, "close", 5);
+ response.value_set(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, "close", 5);
}
void
@@ -7417,11 +7417,10 @@ HttpSM::set_next_state()
release_server_session(true);
t_state.source = HttpTransact::SOURCE_CACHE;
- do_drain_request_body();
-
if (transform_info.vc) {
ink_assert(t_state.hdr_info.client_response.valid() == 0);
ink_assert((t_state.hdr_info.transform_response.valid() ? true : false) == true);
+ do_drain_request_body(t_state.hdr_info.transform_response);
t_state.hdr_info.cache_response.create(HTTP_TYPE_RESPONSE);
t_state.hdr_info.cache_response.copy(&t_state.hdr_info.transform_response);
@@ -7430,6 +7429,7 @@ HttpSM::set_next_state()
tunnel.tunnel_run(p);
} else {
ink_assert((t_state.hdr_info.client_response.valid() ? true : false) == true);
+ do_drain_request_body(t_state.hdr_info.client_response);
t_state.hdr_info.cache_response.create(HTTP_TYPE_RESPONSE);
t_state.hdr_info.cache_response.copy(&t_state.hdr_info.client_response);
diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
index f2144b9..11a40e2 100644
--- a/proxy/http/HttpSM.h
+++ b/proxy/http/HttpSM.h
@@ -479,7 +479,7 @@ protected:
void do_api_callout_internal();
void do_redirect();
void redirect_request(const char *redirect_url, const int redirect_len);
- void do_drain_request_body();
+ void do_drain_request_body(HTTPHdr &response);
void wait_for_full_body();