@@ -6891,7 +6891,10 @@ HttpTransact::handle_request_keep_alive_headers(State *s, HTTPVersion ver, HTTPH
68916891 if (s->current .request_to == PARENT_PROXY && parent_is_proxy (s)) {
68926892 heads->value_set (MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION, " close" , 5 );
68936893 } else {
6894- heads->value_set (MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, " close" , 5 );
6894+ ProxyTransaction *svr = s->state_machine ->get_server_txn ();
6895+ if (svr) {
6896+ svr->set_close_connection (*heads);
6897+ }
68956898 }
68966899 }
68976900 // Note: if we are 1.1, we always need to send the close
@@ -7050,7 +7053,11 @@ HttpTransact::handle_response_keep_alive_headers(State *s, HTTPVersion ver, HTTP
70507053 case KA_CLOSE:
70517054 case KA_DISABLED:
70527055 if (s->client_info .keep_alive != HTTP_NO_KEEPALIVE || (ver == HTTP_1_1)) {
7053- heads->value_set (c_hdr_field_str, c_hdr_field_len, " close" , 5 );
7056+ if (s->client_info .proxy_connect_hdr ) {
7057+ heads->value_set (c_hdr_field_str, c_hdr_field_len, " close" , 5 );
7058+ } else if (s->state_machine ->ua_txn != nullptr ) {
7059+ s->state_machine ->ua_txn ->set_close_connection (*heads);
7060+ }
70547061 s->client_info .keep_alive = HTTP_NO_KEEPALIVE;
70557062 }
70567063 // Note: if we are 1.1, we always need to send the close
0 commit comments