trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject git commit: Added more methods to c++11 api
Date Mon, 03 Sep 2012 03:54:26 GMT
Updated Branches:
  refs/heads/master 98c3c0b49 -> dab051dc1


Added more methods to c++11 api


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/dab051dc
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/dab051dc
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/dab051dc

Branch: refs/heads/master
Commit: dab051dc1d8176a1b441327c47a26262b22dea0f
Parents: 98c3c0b
Author: Brian Geffon <briang@apache.org>
Authored: Sun Sep 2 20:54:07 2012 -0700
Committer: Brian Geffon <briang@apache.org>
Committed: Sun Sep 2 20:54:07 2012 -0700

----------------------------------------------------------------------
 lib/cpp11api/cpp11api.cc |  398 ++++++++++++++++++++++++++++++++++++-----
 lib/cpp11api/ts-cpp11.h  |   65 +++++--
 2 files changed, 400 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dab051dc/lib/cpp11api/cpp11api.cc
----------------------------------------------------------------------
diff --git a/lib/cpp11api/cpp11api.cc b/lib/cpp11api/cpp11api.cc
index d20ee3f..605902b 100644
--- a/lib/cpp11api/cpp11api.cc
+++ b/lib/cpp11api/cpp11api.cc
@@ -1,29 +1,30 @@
 /** @file
-    @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.
+ @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 <arpa/inet.h>
 #include <ts.h>
 #include "ts-cpp11.h"
 
 using namespace ats::api;
 
+namespace {
 TSHttpHookID TSHookIDFromHookType(HookType hook);
 
 class HookContinuationData {
@@ -38,6 +39,7 @@ public:
   TSHttpTxn ts_http_txn_ = NULL;
   TSCont ts_contp_ = NULL;
 };
+}
 
 extern "C" void TSPluginInit(int argc, const char *argv[]) {
 
@@ -62,6 +64,7 @@ extern "C" void TSPluginInit(int argc, const char *argv[]) {
   PluginRegister(arguments);
 }
 
+namespace {
 TSHttpHookID TSHookIDFromHookType(HookType hook) {
   switch (hook) {
   case ats::api::HookType::HOOK_PRE_REMAP:
@@ -84,6 +87,32 @@ TSHttpHookID TSHookIDFromHookType(HookType hook) {
   return TS_HTTP_READ_REQUEST_HDR_HOOK;
 }
 
+void inline ReenableBasedOnNextState(TSHttpTxn txnp, NextState ns) {
+  switch (ns) {
+  case NextState::HTTP_DONT_CONTINUE:
+    return;
+    break;
+  case NextState::HTTP_ERROR:
+    TSHttpTxnReenable(txnp, static_cast<TSEvent>(TS_EVENT_HTTP_ERROR));
+    break;
+  case NextState::HTTP_CONTINUE:
+  default:
+    TSHttpTxnReenable(txnp, static_cast<TSEvent>(TS_EVENT_HTTP_CONTINUE));
+    break;
+  }
+}
+
+std::string printable_sockaddr_ip(sockaddr const * s_sockaddr) {
+  const struct sockaddr_in * s_sockaddr_in =
+      reinterpret_cast<const struct sockaddr_in *>(s_sockaddr);
+
+  char res[INET_ADDRSTRLEN];
+  inet_ntop(AF_INET, &s_sockaddr_in->sin_addr, res, INET_ADDRSTRLEN);
+
+  return std::string(res);
+}
+} /* end anonymous namespace */
+
 std::string ats::api::GetPristineRequestUrl(Transaction &t) {
   TSMBuffer bufp;
   TSMLoc url_loc;
@@ -124,6 +153,162 @@ std::string ats::api::GetRequestUrl(Transaction &t) {
   return url;
 }
 
+std::string ats::api::GetRequestUrlScheme(Transaction &t) {
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
+
+  if (TSHttpTxnClientReqGet(t.ts_http_txn_, &bufp, &hdr_loc) != TS_SUCCESS)
+    return std::string();
+
+  TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc);
+
+  int scheme_length;
+  const char *scheme = TSUrlSchemeGet(bufp, url_loc, &scheme_length);
+
+  std::string ret(scheme, scheme_length);
+
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+
+  return ret;
+}
+
+
+std::string ats::api::GetPristineRequestUrlScheme(Transaction &t) {
+  TSMBuffer bufp;
+  TSMLoc url_loc;
+
+  TSHttpTxnPristineUrlGet(t.ts_http_txn_, &bufp, &url_loc);
+
+  int length;
+  const char *scheme = TSUrlHostGet(bufp, url_loc, &length);
+
+  std::string ret(scheme, length);
+
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, url_loc);
+
+  return ret;
+}
+
+void ats::api::SetRequestUrlScheme(Transaction &t, const std::string &scheme) {
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
+
+  TSHttpTxnClientReqGet(t.ts_http_txn_, &bufp, &hdr_loc);
+  TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc);
+
+  TSUrlHostSet(bufp, url_loc, scheme.c_str(), scheme.length());
+
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+}
+
+
+std::string ats::api::GetRequestUrlQuery(Transaction &t) {
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
+
+  if (TSHttpTxnClientReqGet(t.ts_http_txn_, &bufp, &hdr_loc) != TS_SUCCESS)
+    return std::string();
+
+  TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc);
+
+  int query_length;
+  const char *query = TSUrlHttpQueryGet(bufp, url_loc, &query_length);
+
+  std::string ret(query, query_length);
+
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+
+  return ret;
+}
+
+std::string ats::api::GetPristineRequestUrlQuery(Transaction &t) {
+  TSMBuffer bufp;
+  TSMLoc url_loc;
+
+  TSHttpTxnPristineUrlGet(t.ts_http_txn_, &bufp, &url_loc);
+
+  int query_length;
+  const char *query = TSUrlHostGet(bufp, url_loc, &query_length);
+
+  std::string ret(query, query_length);
+
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, url_loc);
+
+  return ret;
+}
+
+void ats::api::SetRequestUrlQuery(Transaction &t, const std::string &query) {
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
+
+  TSHttpTxnClientReqGet(t.ts_http_txn_, &bufp, &hdr_loc);
+  TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc);
+
+  TSUrlHostSet(bufp, url_loc, query.c_str(), query.length());
+
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+}
+
+std::string ats::api::GetRequestUrlHost(Transaction &t) {
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
+
+  if (TSHttpTxnClientReqGet(t.ts_http_txn_, &bufp, &hdr_loc) != TS_SUCCESS)
+    return std::string();
+
+  TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc);
+
+  int host_length;
+  const char *host = TSUrlHostGet(bufp, url_loc, &host_length);
+
+  std::string ret(host, host_length);
+
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+
+  return ret;
+}
+
+std::string ats::api::GetPristineRequestUrlHost(Transaction &t) {
+  TSMBuffer bufp;
+  TSMLoc url_loc;
+
+  TSHttpTxnPristineUrlGet(t.ts_http_txn_, &bufp, &url_loc);
+
+  int host_length;
+  const char *host = TSUrlHostGet(bufp, url_loc, &host_length);
+
+  std::string ret(host, host_length);
+
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, url_loc);
+
+  return ret;
+}
+
+void ats::api::SetRequestUrlHost(Transaction &t, const std::string &host) {
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
+
+  TSHttpTxnClientReqGet(t.ts_http_txn_, &bufp, &hdr_loc);
+  TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc);
+
+  TSUrlHostSet(bufp, url_loc, host.c_str(), host.length());
+
+
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+}
+
 std::string ats::api::GetRequestUrlPath(Transaction &t) {
   TSMBuffer bufp;
   TSMLoc hdr_loc;
@@ -145,20 +330,74 @@ std::string ats::api::GetRequestUrlPath(Transaction &t) {
   return ret;
 }
 
-void inline ReenableBasedOnNextState(TSHttpTxn txnp, NextState ns)
-{
-  switch (ns) {
-    case NextState::HTTP_DONT_CONTINUE:
-      return;
-      break;
-    case NextState::HTTP_ERROR:
-      TSHttpTxnReenable(txnp, static_cast<TSEvent>(TS_EVENT_HTTP_ERROR));
-      break;
-    case NextState::HTTP_CONTINUE:
-    default:
-      TSHttpTxnReenable(txnp, static_cast<TSEvent>(TS_EVENT_HTTP_CONTINUE));
-      break;
-    }
+unsigned int ats::api::GetRequestUrlPort(Transaction &t) {
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
+
+  TSHttpTxnClientReqGet(t.ts_http_txn_, &bufp, &hdr_loc);
+  TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc);
+  int port = TSUrlPortGet(bufp, url_loc);
+
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+
+  return port;
+}
+
+unsigned int ats::api::GetPristineRequestUrlPort(Transaction &t) {
+  TSMBuffer bufp;
+  TSMLoc url_loc;
+
+  TSHttpTxnPristineUrlGet(t.ts_http_txn_, &bufp, &url_loc);
+  int port = TSUrlPortGet(bufp, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, url_loc); // TODO: is this wrong?
+
+  return port;
+}
+
+void ats::api::SetRequestUrlPort(Transaction &t, unsigned int port) {
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
+
+  TSHttpTxnClientReqGet(t.ts_http_txn_, &bufp, &hdr_loc);
+  TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc);
+
+  TSUrlPortSet(bufp, url_loc, port);
+
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+}
+
+std::string ats::api::GetPristineRequestUrlPath(Transaction &t) {
+  TSMBuffer bufp;
+  TSMLoc url_loc;
+
+  TSHttpTxnPristineUrlGet(t.ts_http_txn_, &bufp, &url_loc);
+
+  int path_length;
+  const char *path = TSUrlPathGet(bufp, url_loc, &path_length);
+
+  std::string ret(path, path_length);
+
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, url_loc);
+
+  return ret;
+}
+
+void ats::api::SetRequestUrlPath(Transaction &t, const std::string &path) {
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+  TSMLoc url_loc;
+
+  TSHttpTxnClientReqGet(t.ts_http_txn_, &bufp, &hdr_loc);
+  TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc);
+
+  TSUrlPathSet(bufp, url_loc, path.c_str(), path.length());
+
+  TSHandleMLocRelease(bufp, hdr_loc, url_loc);
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
 }
 
 static int GlobalContinuationHandler(TSCont contp, TSEvent event, void *edata) {
@@ -168,14 +407,84 @@ static int GlobalContinuationHandler(TSCont contp, TSEvent event, void
*edata) {
   transaction.ts_http_txn_ = txnp;
   transaction.ts_contp_ = contp;
 
-  HookContinuationData *data = static_cast<HookContinuationData*>(TSContDataGet(contp));
-  auto ns = data->callback(transaction);
+  HookContinuationData *data = static_cast<HookContinuationData*>(TSContDataGet(
+      contp));
+
+  ats::api::NextState ns = data->callback(transaction);
   ReenableBasedOnNextState(txnp, ns);
 
   return 0;
 }
 
-static int TransactionContinuationHandler(TSCont contp, TSEvent event, void *edata) {
+std::string ats::api::GetClientIP(Transaction &t) {
+  return printable_sockaddr_ip(TSHttpTxnClientAddrGet(t.ts_http_txn_));
+}
+
+unsigned int ats::api::GetClientPort(Transaction &t) {
+  const struct sockaddr_in * client_sockaddr =
+      reinterpret_cast<const struct sockaddr_in *>(TSHttpTxnClientAddrGet(
+          t.ts_http_txn_));
+
+  return static_cast<unsigned int>(ntohs(client_sockaddr->sin_port));
+}
+
+std::string ats::api::GetServerIncomingIP(Transaction &t) {
+  return printable_sockaddr_ip(TSHttpTxnIncomingAddrGet(t.ts_http_txn_));
+}
+
+unsigned int ats::api::GetServerIncomingPort(Transaction &t) {
+  const struct sockaddr_in * client_sockaddr =
+      reinterpret_cast<const struct sockaddr_in *>(TSHttpTxnIncomingAddrGet(
+          t.ts_http_txn_));
+
+  return static_cast<unsigned int>(ntohs(client_sockaddr->sin_port));
+}
+
+bool ats::api::IsInternalRequest(Transaction &t) {
+  return TSHttpIsInternalRequest(t.ts_http_txn_) == TS_SUCCESS;
+}
+
+int ats::api::GetServerResponseStatusCode(Transaction &t) {
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+
+  TSHttpTxnServerRespGet(t.ts_http_txn_, &bufp, &hdr_loc);
+  int status = TSHttpHdrStatusGet(bufp, hdr_loc);
+
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+
+  return status;
+}
+
+std::string ats::api::GetRequestMethod(Transaction &t) {
+
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+
+  TSHttpTxnClientReqGet(t.ts_http_txn_, &bufp, &hdr_loc);
+
+  int method_len;
+  const char *methodp = TSHttpHdrMethodGet(bufp, hdr_loc, &method_len);
+  std::string method(methodp, method_len);
+
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+
+  return method;
+}
+
+void ats::api::SetRequestMethod(Transaction &t, const std::string &method) {
+  TSMBuffer bufp;
+  TSMLoc hdr_loc;
+
+  TSHttpTxnClientReqGet(t.ts_http_txn_, &bufp, &hdr_loc);
+
+  TSHttpHdrMethodSet(bufp, hdr_loc, method.c_str(), method.length());
+
+  TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
+}
+
+static int TransactionContinuationHandler(TSCont contp, TSEvent event,
+    void *edata) {
   TSHttpTxn txnp = static_cast<TSHttpTxn>(edata);
 
   Transaction transaction;
@@ -183,15 +492,17 @@ static int TransactionContinuationHandler(TSCont contp, TSEvent event,
void *eda
   transaction.ts_contp_ = contp;
 
   NextState ns = NextState::HTTP_CONTINUE;
-  HookContinuationData *data = static_cast<HookContinuationData*>(TSContDataGet(contp));
-  if(event != TS_EVENT_HTTP_TXN_CLOSE || (event == TS_EVENT_HTTP_TXN_CLOSE && data->ts_hook_id
== TS_HTTP_TXN_CLOSE_HOOK))
-  {
+  HookContinuationData *data = static_cast<HookContinuationData*>(TSContDataGet(
+      contp));
+  if (event != TS_EVENT_HTTP_TXN_CLOSE
+      || (event == TS_EVENT_HTTP_TXN_CLOSE
+          && data->ts_hook_id == TS_HTTP_TXN_CLOSE_HOOK)) {
     ns = data->callback(transaction);
   }
 
   // We must free the HookContinuationData structure and continuation
   // If this transaction is complete
-  if(event == TS_EVENT_HTTP_TXN_CLOSE) {
+  if (event == TS_EVENT_HTTP_TXN_CLOSE) {
     delete data;
     TSContDestroy(contp);
   }
@@ -200,7 +511,8 @@ static int TransactionContinuationHandler(TSCont contp, TSEvent event,
void *eda
   return 0;
 }
 
-void ats::api::CreateTransactionHook(Transaction &txn, HookType hook, GlobalHookCallback
callback) {
+void ats::api::CreateTransactionHook(Transaction &txn, HookType hook,
+    GlobalHookCallback callback) {
   TSHttpHookID ts_hook_id = TSHookIDFromHookType(hook);
   TSCont contp = TSContCreate(TransactionContinuationHandler, NULL);
 
@@ -210,10 +522,10 @@ void ats::api::CreateTransactionHook(Transaction &txn, HookType
hook, GlobalHook
   data->ts_hook_id = ts_hook_id;
 
   TSContDataSet(contp, static_cast<void*>(data));
-  TSHttpTxnHookAdd(txn.ts_http_txn_,ts_hook_id, contp);
+  TSHttpTxnHookAdd(txn.ts_http_txn_, ts_hook_id, contp);
 
-  if(ts_hook_id != TS_HTTP_TXN_CLOSE_HOOK) {
-    TSHttpTxnHookAdd(txn.ts_http_txn_,TS_HTTP_TXN_CLOSE_HOOK, contp);
+  if (ts_hook_id != TS_HTTP_TXN_CLOSE_HOOK) {
+    TSHttpTxnHookAdd(txn.ts_http_txn_, TS_HTTP_TXN_CLOSE_HOOK, contp);
   }
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dab051dc/lib/cpp11api/ts-cpp11.h
----------------------------------------------------------------------
diff --git a/lib/cpp11api/ts-cpp11.h b/lib/cpp11api/ts-cpp11.h
index 3fdd2ed..853df44 100644
--- a/lib/cpp11api/ts-cpp11.h
+++ b/lib/cpp11api/ts-cpp11.h
@@ -1,21 +1,21 @@
 /** @file
-    @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.
+ @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.
  */
 
 #ifndef TS_CPP11_H_
@@ -34,7 +34,11 @@ namespace api {
 typedef std::vector<std::string> StringVector;
 
 enum class HookType {
-  HOOK_PRE_REMAP = 100, HOOK_POST_REMAP, HOOK_READ_RESPONSE_HEADER, HOOK_READ_REQUEST_HEADER,
HOOK_SEND_RESPONSE_HEADER
+  HOOK_PRE_REMAP = 100,
+  HOOK_POST_REMAP,
+  HOOK_READ_RESPONSE_HEADER,
+  HOOK_READ_REQUEST_HEADER,
+  HOOK_SEND_RESPONSE_HEADER
 };
 
 enum class NextState {
@@ -54,9 +58,31 @@ typedef std::function<NextState(Transaction &)> GlobalHookCallback;
 void CreateGlobalHook(HookType, GlobalHookCallback);
 void CreateTransactionHook(Transaction &, HookType, GlobalHookCallback);
 
-std::string GetPristineRequestUrl(Transaction &);
 std::string GetRequestUrl(Transaction &);
+std::string GetPristineRequestUrl(Transaction &);
 std::string GetRequestUrlPath(Transaction &);
+std::string GetPristineRequestUrlPath(Transaction &);
+void SetRequestUrlPath(Transaction &, const std::string &);
+std::string GetRequestUrlQuery(Transaction &);
+std::string GetPristineRequestUrlQuery(Transaction &);
+void SetRequestUrlQuery(Transaction &, const std::string &);
+std::string GetRequestUrlHost(Transaction &);
+std::string GetPristineRequestUrlHost(Transaction &);
+void SetRequestUrlHost(Transaction &, const std::string &);
+std::string GetRequestUrlScheme(Transaction &);
+std::string GetPristineRequestUrlScheme(Transaction &);
+void SetRequestUrlScheme(Transaction &, const std::string &);
+unsigned int GetRequestUrlPort(Transaction &);
+unsigned int GetPristineRequestUrlPort(Transaction &);
+void SetRequestUrlPort(Transaction &, unsigned int);
+std::string GetClientIP(Transaction &);
+unsigned int GetClientPort(Transaction &);
+std::string GetServerIncomingIP(Transaction &);
+unsigned int GetServerIncomingPort(Transaction &);
+std::string GetRequestMethod(Transaction &t);
+void SetRequestMethod(Transaction &t, const std::string &);
+int GetServerResponseStatusCode(Transaction &t);
+bool IsInternalRequest(Transaction &);
 
 }
 }
@@ -66,5 +92,4 @@ std::string GetRequestUrlPath(Transaction &);
  */
 void PluginRegister(const ats::api::StringVector &);
 
-
 #endif /* TS_CPP11_H_ */


Mime
View raw message