You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2019/09/25 13:43:00 UTC

[trafficserver] branch master updated (097017d -> 4a19b32)

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

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


    from 097017d  Add AUTest using h2spec
     new 313ba1d  adding TSHttpTxnRedoCacheLookup
     new a743ac3  Fix reference to SMDebug.
     new b0b591b  TSHttpTxnRedoCacheLookup.
     new f04a98b  Add example plugin to show how to use TSRedoCacheLookup.
     new 4a19b32  Add documentation for TSHttpTxnRedoCacheLookup

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ...Push.en.rst => TSHttpTxnRedoCacheLookup.en.rst} |  14 ++-
 include/ts/experimental.h                          |  21 ++++
 plugins/Makefile.am                                |   1 +
 .../Makefile.inc                                   |  10 +-
 plugins/experimental/redo_cache_lookup/README.md   |  11 ++
 .../redo_cache_lookup/redo_cache_lookup.cc         | 111 +++++++++++++++++++++
 proxy/http/HttpSM.cc                               |  11 ++
 proxy/http/HttpSM.h                                |   2 +
 src/traffic_server/InkAPI.cc                       |  20 ++++
 9 files changed, 188 insertions(+), 13 deletions(-)
 copy doc/developer-guide/api/functions/{TSHttpTxnServerPush.en.rst => TSHttpTxnRedoCacheLookup.en.rst} (72%)
 copy plugins/experimental/{server_push_preload => redo_cache_lookup}/Makefile.inc (71%)
 create mode 100644 plugins/experimental/redo_cache_lookup/README.md
 create mode 100644 plugins/experimental/redo_cache_lookup/redo_cache_lookup.cc


[trafficserver] 04/05: Add example plugin to show how to use TSRedoCacheLookup.

Posted by am...@apache.org.
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

commit f04a98b16f5dacdf3db66c9e50822ca851274986
Author: David Calavera <da...@gmail.com>
AuthorDate: Thu Sep 5 11:47:20 2019 -0700

    Add example plugin to show how to use TSRedoCacheLookup.
    
    Signed-off-by: David Calavera <da...@gmail.com>
---
 plugins/Makefile.am                                |   1 +
 .../experimental/redo_cache_lookup/Makefile.inc    |  27 +++++
 plugins/experimental/redo_cache_lookup/README.md   |  11 ++
 .../redo_cache_lookup/redo_cache_lookup.cc         | 111 +++++++++++++++++++++
 4 files changed, 150 insertions(+)

diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 9818f9c..0f41f43 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -71,6 +71,7 @@ include experimental/memcache/Makefile.inc
 include experimental/metalink/Makefile.inc
 include experimental/money_trace/Makefile.inc
 include experimental/mp4/Makefile.inc
+include experimental/redo_cache_lookup/Makefile.inc
 include experimental/server_push_preload/Makefile.inc
 include experimental/slice/Makefile.inc
 include experimental/sslheaders/Makefile.inc
diff --git a/plugins/experimental/redo_cache_lookup/Makefile.inc b/plugins/experimental/redo_cache_lookup/Makefile.inc
new file mode 100644
index 0000000..316d6db
--- /dev/null
+++ b/plugins/experimental/redo_cache_lookup/Makefile.inc
@@ -0,0 +1,27 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+pkglib_LTLIBRARIES += experimental/redo_cache_lookup/redo_cache_lookup.la
+
+experimental_redo_cache_lookup_redo_cache_lookup_la_SOURCES = \
+  experimental/redo_cache_lookup/redo_cache_lookup.cc
+
+experimental_redo_cache_lookup_redo_cache_lookup_la_LDFLAGS = \
+  $(AM_LDFLAGS)
+
+experimental_redo_cache_lookup_redo_cache_lookup_la_LIBADD = \
+  $(top_builddir)/src/tscpp/api/libtscppapi.la
+
diff --git a/plugins/experimental/redo_cache_lookup/README.md b/plugins/experimental/redo_cache_lookup/README.md
new file mode 100644
index 0000000..7ad5dda
--- /dev/null
+++ b/plugins/experimental/redo_cache_lookup/README.md
@@ -0,0 +1,11 @@
+# Redo Cache Lookup Plugin
+
+This plugin shows how to use the experimental `TSHttpTxnRedoCacheLookup` api. It works by checking the cache for a fallback url if the cache lookup failed for any given url.
+
+## Configuration
+
+Add this plugin to `plugin.config` with the `--fallback` option:
+
+```
+redo_cache_lookup.so --fallback http://example.com/fallback_url
+```
\ No newline at end of file
diff --git a/plugins/experimental/redo_cache_lookup/redo_cache_lookup.cc b/plugins/experimental/redo_cache_lookup/redo_cache_lookup.cc
new file mode 100644
index 0000000..b294309
--- /dev/null
+++ b/plugins/experimental/redo_cache_lookup/redo_cache_lookup.cc
@@ -0,0 +1,111 @@
+/** @file
+
+  A plugin to redo cache lookups with a fallback if cache lookups fail for specific urls.
+
+  @section license License
+
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ */
+
+#include <iostream>
+#include <regex>
+#include <set>
+#include <sstream>
+#include <getopt.h>
+
+#include <ts/ts.h>
+#include <ts/experimental.h>
+#include "tscpp/api/GlobalPlugin.h"
+#include "tscpp/api/utils.h"
+
+#define PLUGIN_NAME "redo_cache_lookup"
+
+using namespace atscppapi;
+
+namespace
+{
+GlobalPlugin *plugin;
+}
+
+class RedoCacheLookupPlugin : public GlobalPlugin
+{
+public:
+  RedoCacheLookupPlugin(const char *fallback) : fallback(fallback)
+  {
+    TSDebug(PLUGIN_NAME, "registering transaction hooks");
+    RedoCacheLookupPlugin::registerHook(HOOK_CACHE_LOOKUP_COMPLETE);
+  }
+
+  void
+  handleReadCacheLookupComplete(Transaction &transaction) override
+  {
+    Transaction::CacheStatus status = transaction.getCacheStatus();
+
+    if (status == Transaction::CacheStatus::CACHE_LOOKUP_NONE || status == Transaction::CacheStatus::CACHE_LOOKUP_SKIPED ||
+        status == Transaction::CacheStatus::CACHE_LOOKUP_MISS) {
+      TSDebug(PLUGIN_NAME, "rewinding to check for fallback url: %s", fallback);
+      TSHttpTxn txnp = static_cast<TSHttpTxn>(transaction.getAtsHandle());
+      TSHttpTxnRedoCacheLookup(txnp, fallback, strlen(fallback));
+    }
+
+    transaction.resume();
+  }
+
+private:
+  const char *fallback;
+};
+
+void
+TSPluginInit(int argc, const char *argv[])
+{
+  TSDebug(PLUGIN_NAME, "Init");
+  if (!RegisterGlobalPlugin("RedoCacheLookupPlugin", PLUGIN_NAME, "dev@trafficserver.apache.org")) {
+    return;
+  }
+
+  const char *fallback = nullptr;
+
+  // Read options from plugin.config
+  static const struct option longopts[] = {{"fallback", required_argument, nullptr, 'f'}};
+
+  int opt = 0;
+
+  while (opt >= 0) {
+    opt = getopt_long(argc, const_cast<char *const *>(argv), "f:", longopts, nullptr);
+    switch (opt) {
+    case 'f':
+      fallback = optarg;
+      break;
+    case -1:
+    case '?':
+      break;
+    default:
+      TSDebug(PLUGIN_NAME, "Unexpected option: %i", opt);
+      TSError("[%s] Unexpected options error.", PLUGIN_NAME);
+      return;
+    }
+  }
+
+  if (nullptr == fallback) {
+    TSDebug(PLUGIN_NAME, "Missing fallback option.");
+    TSError("[%s] Missing fallback option", PLUGIN_NAME);
+    return;
+  }
+  TSDebug(PLUGIN_NAME, "Initialized with fallback: %s", fallback);
+
+  plugin = new RedoCacheLookupPlugin(fallback);
+}


[trafficserver] 01/05: adding TSHttpTxnRedoCacheLookup

Posted by am...@apache.org.
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

commit 313ba1d306104e1c277e98cbd46072ada9f817ba
Author: Daniel Morilha (netlify) <da...@netlify.com>
AuthorDate: Mon Nov 5 12:49:51 2018 -0800

    adding TSHttpTxnRedoCacheLookup
---
 include/ts/experimental.h    |  1 +
 proxy/http/HttpSM.cc         | 10 ++++++++++
 proxy/http/HttpSM.h          |  2 ++
 src/traffic_server/InkAPI.cc | 46 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 59 insertions(+)

diff --git a/include/ts/experimental.h b/include/ts/experimental.h
index fa8e7ea..a1bab6f 100644
--- a/include/ts/experimental.h
+++ b/include/ts/experimental.h
@@ -198,6 +198,7 @@ tsapi TSReturnCode TSHttpTxnCacheLookupCountGet(TSHttpTxn txnp, int *lookup_coun
 tsapi TSReturnCode TSHttpTxnServerRespIgnore(TSHttpTxn txnp);
 tsapi TSReturnCode TSHttpTxnShutDown(TSHttpTxn txnp, TSEvent event);
 tsapi TSReturnCode TSHttpTxnCloseAfterResponse(TSHttpTxn txnp, int should_close);
+tsapi void TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char *, const int, const char *, const char *);
 
 /****************************************************************************
  *  ??
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 793b82f..e9398c7 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1511,6 +1511,11 @@ plugins required to work with sni_routing.
     case HTTP_API_DEFERED_SERVER_ERROR:
       api_next = API_RETURN_DEFERED_SERVER_ERROR;
       break;
+    case HTTP_API_REWIND_STATE_MACHINE:
+      DebugSM("http", "REWIND");
+      callout_state = HTTP_API_NO_CALLOUT;
+      set_next_state();
+      return 0;
     default:
       ink_release_assert(0);
     }
@@ -8027,6 +8032,11 @@ HttpSM::find_proto_string(HTTPVersion version) const
   return {};
 }
 
+void
+HttpSM::rewind_state_machine() {
+  callout_state = HTTP_API_REWIND_STATE_MACHINE;
+}
+
 // YTS Team, yamsat Plugin
 // Function to copy the partial Post data while tunnelling
 void
diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
index 748d307..931c725 100644
--- a/proxy/http/HttpSM.h
+++ b/proxy/http/HttpSM.h
@@ -155,6 +155,7 @@ enum HttpApiState_t {
   HTTP_API_IN_CALLOUT,
   HTTP_API_DEFERED_CLOSE,
   HTTP_API_DEFERED_SERVER_ERROR,
+  HTTP_API_REWIND_STATE_MACHINE,
 };
 
 enum HttpPluginTunnel_t {
@@ -615,6 +616,7 @@ public:
   void set_server_netvc_inactivity_timeout(NetVConnection *netvc);
   void set_server_netvc_active_timeout(NetVConnection *netvc);
   void set_server_netvc_connect_timeout(NetVConnection *netvc);
+  void rewind_state_machine();
 
 private:
   PostDataBuffers _postbuf;
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index b61fdc0..88389cd 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -9789,6 +9789,52 @@ TSRegisterProtocolTag(const char *tag)
   return nullptr;
 }
 
+void
+TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char * host, const int port,
+    const char * path, const char * query)
+{
+  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
+  HttpSM *sm                     = (HttpSM *)txnp;
+  HttpTransact::State * s        = &(sm->t_state);
+  sdk_assert(s->next_action == HttpTransact::SM_ACTION_CACHE_LOOKUP);
+  s->transact_return_point       = nullptr;
+
+  sm->rewind_state_machine();
+
+  TSMBuffer buffer = nullptr;
+  TSMLoc location = nullptr, location2 = nullptr;
+
+  TSHttpTxnClientReqGet(txnp, &buffer, &location);
+  TSHttpHdrUrlGet(buffer, location, &location2);
+
+  //host
+  if (nullptr != host) {
+    const int length = strlen(host);
+    TSUrlHostSet(buffer, location2, host, length);
+  }
+
+  //port
+  if (0 < port) {
+    TSUrlPortSet(buffer, location2, port);
+  }
+
+  //path
+  if (nullptr != path) {
+    const int length = strlen(path);
+    TSUrlPathSet(buffer, location2, path, length);
+  }
+
+  //query
+  if (nullptr != query) {
+    const int length = strlen(query);
+    TSUrlHttpQuerySet(buffer, location2, query, length);
+  }
+
+  TSHandleMLocRelease(buffer, location, location2);
+  TSHandleMLocRelease(buffer, TS_NULL_MLOC, location);
+}
+
+
 namespace
 {
 // Function that contains the common logic for TSRemapFrom/ToUrlGet().


[trafficserver] 02/05: Fix reference to SMDebug.

Posted by am...@apache.org.
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

commit a743ac31c4bc47efcc4cdad9b4878656b3a34f47
Author: David Calavera <da...@gmail.com>
AuthorDate: Wed Aug 14 09:42:16 2019 -0700

    Fix reference to SMDebug.
    
    Signed-off-by: David Calavera <da...@gmail.com>
---
 proxy/http/HttpSM.cc         |  5 +++--
 src/traffic_server/InkAPI.cc | 18 ++++++++----------
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index e9398c7..f1df885 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1512,7 +1512,7 @@ plugins required to work with sni_routing.
       api_next = API_RETURN_DEFERED_SERVER_ERROR;
       break;
     case HTTP_API_REWIND_STATE_MACHINE:
-      DebugSM("http", "REWIND");
+      SMDebug("http", "REWIND");
       callout_state = HTTP_API_NO_CALLOUT;
       set_next_state();
       return 0;
@@ -8033,7 +8033,8 @@ HttpSM::find_proto_string(HTTPVersion version) const
 }
 
 void
-HttpSM::rewind_state_machine() {
+HttpSM::rewind_state_machine()
+{
   callout_state = HTTP_API_REWIND_STATE_MACHINE;
 }
 
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 88389cd..2833042 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -9790,14 +9790,13 @@ TSRegisterProtocolTag(const char *tag)
 }
 
 void
-TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char * host, const int port,
-    const char * path, const char * query)
+TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char *host, const int port, const char *path, const char *query)
 {
   sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
-  HttpSM *sm                     = (HttpSM *)txnp;
-  HttpTransact::State * s        = &(sm->t_state);
+  HttpSM *sm             = (HttpSM *)txnp;
+  HttpTransact::State *s = &(sm->t_state);
   sdk_assert(s->next_action == HttpTransact::SM_ACTION_CACHE_LOOKUP);
-  s->transact_return_point       = nullptr;
+  s->transact_return_point = nullptr;
 
   sm->rewind_state_machine();
 
@@ -9807,24 +9806,24 @@ TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char * host, const int port,
   TSHttpTxnClientReqGet(txnp, &buffer, &location);
   TSHttpHdrUrlGet(buffer, location, &location2);
 
-  //host
+  // host
   if (nullptr != host) {
     const int length = strlen(host);
     TSUrlHostSet(buffer, location2, host, length);
   }
 
-  //port
+  // port
   if (0 < port) {
     TSUrlPortSet(buffer, location2, port);
   }
 
-  //path
+  // path
   if (nullptr != path) {
     const int length = strlen(path);
     TSUrlPathSet(buffer, location2, path, length);
   }
 
-  //query
+  // query
   if (nullptr != query) {
     const int length = strlen(query);
     TSUrlHttpQuerySet(buffer, location2, query, length);
@@ -9834,7 +9833,6 @@ TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char * host, const int port,
   TSHandleMLocRelease(buffer, TS_NULL_MLOC, location);
 }
 
-
 namespace
 {
 // Function that contains the common logic for TSRemapFrom/ToUrlGet().


[trafficserver] 03/05: TSHttpTxnRedoCacheLookup.

Posted by am...@apache.org.
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

commit b0b591b994248d7304497755e471409b31dab2d1
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Tue Aug 20 10:06:11 2019 -0500

    TSHttpTxnRedoCacheLookup.
---
 include/ts/experimental.h    | 22 +++++++++++++++++++-
 src/traffic_server/InkAPI.cc | 48 +++++++++++---------------------------------
 2 files changed, 33 insertions(+), 37 deletions(-)

diff --git a/include/ts/experimental.h b/include/ts/experimental.h
index a1bab6f..3754fb0 100644
--- a/include/ts/experimental.h
+++ b/include/ts/experimental.h
@@ -198,7 +198,27 @@ tsapi TSReturnCode TSHttpTxnCacheLookupCountGet(TSHttpTxn txnp, int *lookup_coun
 tsapi TSReturnCode TSHttpTxnServerRespIgnore(TSHttpTxn txnp);
 tsapi TSReturnCode TSHttpTxnShutDown(TSHttpTxn txnp, TSEvent event);
 tsapi TSReturnCode TSHttpTxnCloseAfterResponse(TSHttpTxn txnp, int should_close);
-tsapi void TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char *, const int, const char *, const char *);
+
+/** Do another cache lookup with a different cache key.
+ *
+ * @param txnp Transaction.
+ * @param url URL to use for cache key.
+ * @param length Length of the string in @a url
+ *
+ * @return @c TS_SUCCESS on success, @c TS_ERROR if the @a txnp is invalid or the @a url is
+ * not a valid URL.
+ *
+ * If @a length is negative, @c strlen will be used to determine the length of @a url.
+ *
+ * @a url must be syntactically a URL, but otherwise it is just a string and does not need to
+ * be retrievable.
+ *
+ * This can only be called in a @c TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK callback. To set the cache
+ * key for the first lookup, use @c TSCacheUrlSet.
+ *
+ * @see TSCacheUrlSet
+ */
+tsapi TSReturnCode TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char *url, int length);
 
 /****************************************************************************
  *  ??
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 2833042..d0870ef 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -9789,48 +9789,24 @@ TSRegisterProtocolTag(const char *tag)
   return nullptr;
 }
 
-void
-TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char *host, const int port, const char *path, const char *query)
+TSReturnCode
+TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char *url, int length)
 {
   sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
-  HttpSM *sm             = (HttpSM *)txnp;
+
+  HttpSM *sm             = reinterpret_cast<HttpSM *>(txnp);
   HttpTransact::State *s = &(sm->t_state);
   sdk_assert(s->next_action == HttpTransact::SM_ACTION_CACHE_LOOKUP);
-  s->transact_return_point = nullptr;
-
-  sm->rewind_state_machine();
-
-  TSMBuffer buffer = nullptr;
-  TSMLoc location = nullptr, location2 = nullptr;
-
-  TSHttpTxnClientReqGet(txnp, &buffer, &location);
-  TSHttpHdrUrlGet(buffer, location, &location2);
-
-  // host
-  if (nullptr != host) {
-    const int length = strlen(host);
-    TSUrlHostSet(buffer, location2, host, length);
-  }
-
-  // port
-  if (0 < port) {
-    TSUrlPortSet(buffer, location2, port);
-  }
-
-  // path
-  if (nullptr != path) {
-    const int length = strlen(path);
-    TSUrlPathSet(buffer, location2, path, length);
-  }
 
-  // query
-  if (nullptr != query) {
-    const int length = strlen(query);
-    TSUrlHttpQuerySet(buffer, location2, query, length);
+  // Because of where this is in the state machine, the storage for the cache_info URL must
+  // have already been initialized and @a lookup_url must be valid.
+  auto result = s->cache_info.lookup_url->parse(url, length < 0 ? strlen(url) : length);
+  if (PARSE_RESULT_DONE == result) {
+    s->transact_return_point = nullptr;
+    sm->rewind_state_machine();
+    return TS_SUCCESS;
   }
-
-  TSHandleMLocRelease(buffer, location, location2);
-  TSHandleMLocRelease(buffer, TS_NULL_MLOC, location);
+  return TS_ERROR;
 }
 
 namespace


[trafficserver] 05/05: Add documentation for TSHttpTxnRedoCacheLookup

Posted by am...@apache.org.
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

commit 4a19b32446427b98be43fb357ca7ccffbb9d7a86
Author: David Calavera <da...@gmail.com>
AuthorDate: Fri Sep 13 15:07:16 2019 -0700

    Add documentation for TSHttpTxnRedoCacheLookup
    
    Signed-off-by: David Calavera <da...@gmail.com>
---
 .../api/functions/TSHttpTxnRedoCacheLookup.en.rst  | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/doc/developer-guide/api/functions/TSHttpTxnRedoCacheLookup.en.rst b/doc/developer-guide/api/functions/TSHttpTxnRedoCacheLookup.en.rst
new file mode 100644
index 0000000..01f174b
--- /dev/null
+++ b/doc/developer-guide/api/functions/TSHttpTxnRedoCacheLookup.en.rst
@@ -0,0 +1,48 @@
+.. Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed
+   with this work for additional information regarding copyright
+   ownership.  The ASF licenses this file to you under the Apache
+   License, Version 2.0 (the "License"); you may not use this file
+   except in compliance with the License.  You may obtain a copy of
+   the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+   implied.  See the License for the specific language governing
+   permissions and limitations under the License.
+
+.. include:: ../../../common.defs
+
+.. default-domain:: c
+
+TSHttpTxnRedoCacheLookup
+*******************
+
+Synopsis
+========
+
+`#include <ts/experimental.h>`
+
+.. function:: TSReturnCode TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char *url, int length)
+
+Description
+===========
+
+Perform a cache lookup with a different url.
+This function rewinds the state machine to perform the new cache lookup. The cache_info for the new
+url must have been initialized before calling this function.
+
+If the length argument is -1, this function will take the length from the url argument.
+
+Notes
+=====
+
+This API may be changed in the future version since it is experimental.
+
+See Also
+========
+
+:manpage:`TSAPI(3ts)`,