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

amc 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 4743718  Doc: Document TSHttpTxnServerRespGet.
4743718 is described below

commit 4743718007717b73e9c1f6fa1a52fe266975b590
Author: Alan M. Carroll <[email protected]>
AuthorDate: Tue Nov 27 17:08:01 2018 -0600

    Doc: Document TSHttpTxnServerRespGet.
---
 .../api/functions/TSHttpTxnServerRespGet.en.rst    | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/doc/developer-guide/api/functions/TSHttpTxnServerRespGet.en.rst 
b/doc/developer-guide/api/functions/TSHttpTxnServerRespGet.en.rst
index 9150f1d..3113297 100644
--- a/doc/developer-guide/api/functions/TSHttpTxnServerRespGet.en.rst
+++ b/doc/developer-guide/api/functions/TSHttpTxnServerRespGet.en.rst
@@ -30,3 +30,25 @@ Synopsis
 
 Description
 ===========
+
+Get the response header sent by the upstream server. This will only be useful 
in a callback on a
+hook that is called after the upstream responds, and if there was an upstream 
response. For
+instance, if the inbound request has no remap rule and :ts:cv:`remap is 
required
+<proxy.config.url_remap.remap_required>` then there will be no server response 
because no outbound
+connection was made. In this case the function will return :c:macro:`TS_ERROR`.
+
+The response header is returned in :arg:`bufp` and :arg:`offset`. :arg:`bufp` 
is the heap in which
+the header resides, and :arg:`offset` is the location in that heap. These will 
be used in subsequent
+calls to retrieve information from the header.
+
+.. code-block:: cpp
+   :emphasize-lines: 4
+
+   int get_response_status(TSHttpTxn txn) {
+      TSMBuffer resp_heap = nullptr;
+      TSMLoc resp_hdr = nullptr;
+      if (TS_SUCCESS == TSHttpTxnServerRespGet(tnx, &resp_heap, &resp_hdr)) {
+         return TSHttpHdrStatusGet(resp_headp, resp_hdr);
+      }
+      return HTTP_STATUS_NONE;
+   }

Reply via email to