You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by br...@apache.org on 2013/01/30 20:48:06 UTC

git commit: TS-1675: Adding api TSHttpTxnClientIncomingPortSet

Updated Branches:
  refs/heads/master 6d573ce58 -> 561269868


TS-1675: Adding api TSHttpTxnClientIncomingPortSet


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

Branch: refs/heads/master
Commit: 561269868855deb25f0925dffc61da50209420a8
Parents: 6d573ce
Author: Brian Geffon <br...@apache.org>
Authored: Wed Jan 30 11:47:57 2013 -0800
Committer: Brian Geffon <br...@apache.org>
Committed: Wed Jan 30 11:47:57 2013 -0800

----------------------------------------------------------------------
 CHANGES              |    2 ++
 proxy/InkAPI.cc      |    8 ++++++++
 proxy/api/ts/ts.h.in |    2 ++
 3 files changed, 12 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/56126986/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 0249742..85cfbe6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 3.3.1
+  *) [TS-1675] Adding API method TSHttpTxnClientIncomingPortSet
+
   *) [TS-1674] TSStatIntDecrement is broken: the logic is flawed.
 
   *) [TS-1673] Remap with recv port is using the wrong port 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/56126986/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index dbb33b2..f46ade6 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -5306,6 +5306,14 @@ TSHttpTxnServerAddrSet(TSHttpTxn txnp, struct sockaddr const* addr)
   }
 }
 
+void
+TSHttpTxnClientIncomingPortSet(TSHttpTxn txnp, int port)
+{
+  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
+
+  HttpSM *sm = (HttpSM *) txnp;
+  sm->t_state.client_info.port = port;
+}
 
 // [amc] This might use the port. The code path should do that but it
 // hasn't been tested.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/56126986/proxy/api/ts/ts.h.in
----------------------------------------------------------------------
diff --git a/proxy/api/ts/ts.h.in b/proxy/api/ts/ts.h.in
index 8a2abd6..213b4e8 100644
--- a/proxy/api/ts/ts.h.in
+++ b/proxy/api/ts/ts.h.in
@@ -2269,6 +2269,8 @@ extern "C"
 
   tsapi TSReturnCode TSHttpTxnTransformRespGet(TSHttpTxn txnp, TSMBuffer* bufp, TSMLoc* offset);
 
+  tsapi void TSHttpTxnClientIncomingPortSet(TSHttpTxn txnp, int port);
+
   /** Get client address for transaction @a txnp.
       Retrieves the socket address of the remote client that has
       connected to Traffic Server for transaction @a txnp. The


Re: git commit: TS-1675: Adding api TSHttpTxnClientIncomingPortSet

Posted by Igor Galić <i....@brainsware.org>.
On Wednesday, January 30, 2013 07:48:06 PM briang@apache.org wrote:
> Updated Branches:
>   refs/heads/master 6d573ce58 -> 561269868
> 
> 
> TS-1675: Adding api TSHttpTxnClientIncomingPortSet
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/56126986
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/56126986
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/56126986
> 
> Branch: refs/heads/master
> Commit: 561269868855deb25f0925dffc61da50209420a8
> Parents: 6d573ce
> Author: Brian Geffon <br...@apache.org>
> Authored: Wed Jan 30 11:47:57 2013 -0800
> Committer: Brian Geffon <br...@apache.org>
> Committed: Wed Jan 30 11:47:57 2013 -0800
> 
> ----------------------------------------------------------------------
>  CHANGES              |    2 ++
>  proxy/InkAPI.cc      |    8 ++++++++
>  proxy/api/ts/ts.h.in |    2 ++
>  3 files changed, 12 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/56126986/CHANGES
> ----------------------------------------------------------------------
> diff --git a/CHANGES b/CHANGES
> index 0249742..85cfbe6 100644
> --- a/CHANGES
> +++ b/CHANGES
> @@ -1,5 +1,7 @@
>                                                           -*- coding: utf-8
> -*- Changes with Apache Traffic Server 3.3.1
> +  *) [TS-1675] Adding API method TSHttpTxnClientIncomingPortSet
> +
>    *) [TS-1674] TSStatIntDecrement is broken: the logic is flawed.
> 
>    *) [TS-1673] Remap with recv port is using the wrong port
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/56126986/proxy/Ink
> API.cc
> ---------------------------------------------------------------------- diff
> --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
> index dbb33b2..f46ade6 100644
> --- a/proxy/InkAPI.cc
> +++ b/proxy/InkAPI.cc
> @@ -5306,6 +5306,14 @@ TSHttpTxnServerAddrSet(TSHttpTxn txnp, struct
> sockaddr const* addr) }
>  }
> 
> +void
> +TSHttpTxnClientIncomingPortSet(TSHttpTxn txnp, int port)
> +{
> +  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
> +
> +  HttpSM *sm = (HttpSM *) txnp;
> +  sm->t_state.client_info.port = port;
> +}
> 
>  // [amc] This might use the port. The code path should do that but it
>  // hasn't been tested.
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/56126986/proxy/api
> /ts/ts.h.in
> ---------------------------------------------------------------------- diff
> --git a/proxy/api/ts/ts.h.in b/proxy/api/ts/ts.h.in
> index 8a2abd6..213b4e8 100644
> --- a/proxy/api/ts/ts.h.in
> +++ b/proxy/api/ts/ts.h.in
> @@ -2269,6 +2269,8 @@ extern "C"
> 
>    tsapi TSReturnCode TSHttpTxnTransformRespGet(TSHttpTxn txnp, TSMBuffer*
> bufp, TSMLoc* offset);
 
New API Call, but no tests?

> +  tsapi void TSHttpTxnClientIncomingPortSet(TSHttpTxn txnp, int port);
> +
>    /** Get client address for transaction @a txnp.
>        Retrieves the socket address of the remote client that has
>        connected to Traffic Server for transaction @a txnp. The

Re: git commit: TS-1675: Adding api TSHttpTxnClientIncomingPortSet

Posted by James Peach <jp...@apache.org>.
On 30/01/2013, at 11:48 AM, briang@apache.org wrote:

> Updated Branches:
>  refs/heads/master 6d573ce58 -> 561269868
> 
> 
> TS-1675: Adding api TSHttpTxnClientIncomingPortSet

Hey Brian, what's this API good for?

Did you consider implementing TSHttpTxnIncomingAddrSet() instead? That would be a counterpart to TSHttpTxnIncomingAddrGet() and slightly more general.

Maybe I'm not reading the code right, but in HttpSM::attach_client_session(), t_state.client_info is set using netvc->get_remote_addr(). vc->get_remote_addr() is the result of TSHttpTxnClientAddrGet(), so which port are you intending to set here? The port that ATS thinks the client is coming from, or the port that it has accepted the connection on?

Would you mind writing a man page for this? :)

> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/56126986
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/56126986
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/56126986
> 
> Branch: refs/heads/master
> Commit: 561269868855deb25f0925dffc61da50209420a8
> Parents: 6d573ce
> Author: Brian Geffon <br...@apache.org>
> Authored: Wed Jan 30 11:47:57 2013 -0800
> Committer: Brian Geffon <br...@apache.org>
> Committed: Wed Jan 30 11:47:57 2013 -0800
> 
> ----------------------------------------------------------------------
> CHANGES              |    2 ++
> proxy/InkAPI.cc      |    8 ++++++++
> proxy/api/ts/ts.h.in |    2 ++
> 3 files changed, 12 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/56126986/CHANGES
> ----------------------------------------------------------------------
> diff --git a/CHANGES b/CHANGES
> index 0249742..85cfbe6 100644
> --- a/CHANGES
> +++ b/CHANGES
> @@ -1,5 +1,7 @@
>                                                          -*- coding: utf-8 -*-
> Changes with Apache Traffic Server 3.3.1
> +  *) [TS-1675] Adding API method TSHttpTxnClientIncomingPortSet
> +
>   *) [TS-1674] TSStatIntDecrement is broken: the logic is flawed.
> 
>   *) [TS-1673] Remap with recv port is using the wrong port 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/56126986/proxy/InkAPI.cc
> ----------------------------------------------------------------------
> diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
> index dbb33b2..f46ade6 100644
> --- a/proxy/InkAPI.cc
> +++ b/proxy/InkAPI.cc
> @@ -5306,6 +5306,14 @@ TSHttpTxnServerAddrSet(TSHttpTxn txnp, struct sockaddr const* addr)
>   }
> }
> 
> +void
> +TSHttpTxnClientIncomingPortSet(TSHttpTxn txnp, int port)
> +{
> +  sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
> +
> +  HttpSM *sm = (HttpSM *) txnp;
> +  sm->t_state.client_info.port = port;
> +}
> 
> // [amc] This might use the port. The code path should do that but it
> // hasn't been tested.
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/56126986/proxy/api/ts/ts.h.in
> ----------------------------------------------------------------------
> diff --git a/proxy/api/ts/ts.h.in b/proxy/api/ts/ts.h.in
> index 8a2abd6..213b4e8 100644
> --- a/proxy/api/ts/ts.h.in
> +++ b/proxy/api/ts/ts.h.in
> @@ -2269,6 +2269,8 @@ extern "C"
> 
>   tsapi TSReturnCode TSHttpTxnTransformRespGet(TSHttpTxn txnp, TSMBuffer* bufp, TSMLoc* offset);
> 
> +  tsapi void TSHttpTxnClientIncomingPortSet(TSHttpTxn txnp, int port);
> +
>   /** Get client address for transaction @a txnp.
>       Retrieves the socket address of the remote client that has
>       connected to Traffic Server for transaction @a txnp. The
>