You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2019/11/18 04:03:21 UTC

[trafficserver] branch 9.0.x updated: Remove HttpTransact::build_upgrade_response

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 97db818  Remove HttpTransact::build_upgrade_response
97db818 is described below

commit 97db8184b9a9b3c8852a182c976cef8085476a66
Author: Randall Meyer <rr...@apple.com>
AuthorDate: Fri Nov 15 12:52:15 2019 +0800

    Remove HttpTransact::build_upgrade_response
    
    The code that called this was removed in
    2a42c0ed8d4b8967f42b215bbb39e7f2319b8745
    
    (cherry picked from commit 26f7f0af1725da9f0537da29bc4944cd6a4c44ba)
---
 proxy/http/HttpTransact.cc | 18 ------------------
 proxy/http/HttpTransact.h  |  1 -
 2 files changed, 19 deletions(-)

diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 6c673fc..59d8f2b 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -7962,24 +7962,6 @@ HttpTransact::build_redirect_response(State *s)
   s->arena.str_free(to_free);
 }
 
-void
-HttpTransact::build_upgrade_response(State *s)
-{
-  TxnDebug("http_upgrade", "[HttpTransact::build_upgrade_response]");
-
-  // 101 Switching Protocols
-  HTTPStatus status_code    = HTTP_STATUS_SWITCHING_PROTOCOL;
-  const char *reason_phrase = http_hdr_reason_lookup(status_code);
-  build_response(s, &s->hdr_info.client_response, s->client_info.http_version, status_code, reason_phrase);
-
-  //////////////////////////
-  // set upgrade headers  //
-  //////////////////////////
-  HTTPHdr *h = &s->hdr_info.client_response;
-  h->value_set(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, "Upgrade", strlen("Upgrade"));
-  h->value_set(MIME_FIELD_UPGRADE, MIME_LEN_UPGRADE, MIME_UPGRADE_H2C_TOKEN, strlen(MIME_UPGRADE_H2C_TOKEN));
-}
-
 const char *
 HttpTransact::get_error_string(int erno)
 {
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index 59948c7..093cba1 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -1057,7 +1057,6 @@ public:
   static void build_error_response(State *s, HTTPStatus status_code, const char *reason_phrase_or_null,
                                    const char *error_body_type);
   static void build_redirect_response(State *s);
-  static void build_upgrade_response(State *s);
   static const char *get_error_string(int erno);
 
   // the stat functions