trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r1197499 - in /trafficserver/traffic/trunk: CHANGES proxy/InkAPI.cc proxy/api/ts/ts.h.in
Date Fri, 04 Nov 2011 10:55:05 GMT
Author: niq
Date: Fri Nov  4 10:55:04 2011
New Revision: 1197499

URL: http://svn.apache.org/viewvc?rev=1197499&view=rev
Log:
TS-1008: Add API to access TCP connection from SSN.

Modified:
    trafficserver/traffic/trunk/CHANGES
    trafficserver/traffic/trunk/proxy/InkAPI.cc
    trafficserver/traffic/trunk/proxy/api/ts/ts.h.in

Modified: trafficserver/traffic/trunk/CHANGES
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/CHANGES?rev=1197499&r1=1197498&r2=1197499&view=diff
==============================================================================
--- trafficserver/traffic/trunk/CHANGES (original)
+++ trafficserver/traffic/trunk/CHANGES Fri Nov  4 10:55:04 2011
@@ -130,6 +130,8 @@ Changes with Apache Traffic Server 3.1.1
 
   *) [TS-930] Fixed TSNetConnect to use network order for port.
 
+  *) [TS-1008] Add API to get TCP connection from SSN.
+
 Changes with Apache Traffic Server 3.1.0
   *) Make sure --enable-purify works again
 

Modified: trafficserver/traffic/trunk/proxy/InkAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPI.cc?rev=1197499&r1=1197498&r2=1197499&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkAPI.cc Fri Nov  4 10:55:04 2011
@@ -5143,11 +5143,8 @@ TSHttpTxnTransformRespGet(TSHttpTxn txnp
 }
 
 sockaddr const*
-TSHttpTxnClientAddrGet(TSHttpTxn txnp)
+TSHttpSsnClientAddrGet(TSHttpSsn ssnp)
 {
-  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
- 
-  TSHttpSsn ssnp = TSHttpTxnSsnGet(txnp);
   HttpClientSession *cs = reinterpret_cast<HttpClientSession *>(ssnp);
 
   if (cs == NULL) return 0;
@@ -5157,6 +5154,14 @@ TSHttpTxnClientAddrGet(TSHttpTxn txnp)
 
   return vc->get_remote_addr();
 }
+sockaddr const*
+TSHttpTxnClientAddrGet(TSHttpTxn txnp)
+{
+  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
+ 
+  TSHttpSsn ssnp = TSHttpTxnSsnGet(txnp);
+  return TSHttpSsnClientAddrGet(ssnp);
+}
 
 unsigned int
 TSHttpTxnClientIPGet(TSHttpTxn txnp)
@@ -5168,10 +5173,7 @@ TSHttpTxnClientIPGet(TSHttpTxn txnp)
 }
 
 sockaddr const*
-TSHttpTxnIncomingAddrGet(TSHttpTxn txnp) {
-  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
- 
-  TSHttpSsn ssnp = TSHttpTxnSsnGet(txnp);
+TSHttpSsnIncomingAddrGet(TSHttpSsn ssnp) {
   HttpClientSession *cs = reinterpret_cast<HttpClientSession *>(ssnp);
 
   if (cs == NULL) return 0;
@@ -5181,6 +5183,13 @@ TSHttpTxnIncomingAddrGet(TSHttpTxn txnp)
 
   return vc->get_local_addr();
 }
+sockaddr const*
+TSHttpTxnIncomingAddrGet(TSHttpTxn txnp) {
+  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
+ 
+  TSHttpSsn ssnp = TSHttpTxnSsnGet(txnp);
+  return TSHttpSsnIncomingAddrGet(ssnp);
+}
 
 int
 TSHttpTxnClientIncomingPortGet(TSHttpTxn txnp)
@@ -6768,12 +6777,10 @@ TSTextLogObjectRollingOffsetHrSet(TSText
 }
 
 TSReturnCode
-TSHttpTxnClientFdGet(TSHttpTxn txnp, int *fdp)
+TSHttpSsnClientFdGet(TSHttpSsn ssnp, int *fdp)
 {
-  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
   sdk_assert(sdk_sanity_check_null_ptr((void*)fdp) == TS_SUCCESS);
 
-  TSHttpSsn ssnp = TSHttpTxnSsnGet(txnp);
   HttpClientSession *cs = (HttpClientSession *) ssnp;
 
   if (cs == NULL)
@@ -6786,6 +6793,15 @@ TSHttpTxnClientFdGet(TSHttpTxn txnp, int
   *fdp = vc->get_socket();
   return TS_SUCCESS;
 }
+TSReturnCode
+TSHttpTxnClientFdGet(TSHttpTxn txnp, int *fdp)
+{
+  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
+  sdk_assert(sdk_sanity_check_null_ptr((void*)fdp) == TS_SUCCESS);
+
+  TSHttpSsn ssnp = TSHttpTxnSsnGet(txnp);
+  return TSHttpSsnClientFdGet(ssnp, fdp);
+}
 
 TSReturnCode
 TSHttpTxnClientRemotePortGet(TSHttpTxn txnp, int *portp)

Modified: trafficserver/traffic/trunk/proxy/api/ts/ts.h.in
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/api/ts/ts.h.in?rev=1197499&r1=1197498&r2=1197499&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/api/ts/ts.h.in (original)
+++ trafficserver/traffic/trunk/proxy/api/ts/ts.h.in Fri Nov  4 10:55:04 2011
@@ -2147,7 +2147,13 @@ extern "C"
 
   tsapi TSReturnCode TSHttpTxnClientFdGet(TSHttpTxn txnp, int* fdp);
   tsapi TSReturnCode TSHttpTxnOutgoingAddrSet(TSHttpTxn txnp, struct sockaddr const* addr);
-  
+
+  /* TS-1008: the above TXN calls for the Client conn should work with SSN */
+  tsapi struct sockaddr const* TSHttpSsnClientAddrGet(TSHttpSsn ssnp);
+  tsapi struct sockaddr const* TSHttpSsnIncomingAddrGet(TSHttpSsn ssnp);
+  tsapi TSReturnCode TSHttpSsnClientFdGet(TSHttpSsn ssnp, int* fdp);
+  /* TS-1008 END */
+
   /** @deprecated Use TSHttpTxnClientAddrGet */
   tsapi TS_DEPRECATED unsigned int TSHttpTxnClientIPGet(TSHttpTxn txnp);
   /** @deprecated Use TSHttpTxnClientAddrGet */



Mime
View raw message