> On Feb 3, 2015, at 9:27 AM, Sudheer Vinukonda 
> <sudhe...@yahoo-inc.com.INVALID> wrote:
> 
> The TSHttpTxnServerTransactionClientAbortGet()  seems like a subset of the 
> existing TS API TSHttpTxnAborted() (that returns TS_SUCCESS on either a 
> client abort or a server abort).  Would it make sense to extend the existing 
> API (instead of a new one) to provide additional information? 


Nice catch. It certainly feels that even if the two APIs are similar, but not 
the same, we ought to stick to the existing naming convention such that we 
don’t add on to the confusion?

— Leif


> Thanks,
> Sudheer     On Tuesday, February 3, 2015 8:13 AM, "Bardwell, William" 
> <wbard...@akamai.com> wrote:
> 
> 
> These were bits of information that we needed in our plugin to tell what 
> state things were really in about the connections on either side.  The 
> information is being maintained for internal use, so we just needed to export 
> it.  The only compatibility issues is around any changes to the state machine 
> might need similar changes to the implementations of these functions.
> The one other issue the name TSHttpTxnServerTransactionClientAbortGet?() 
> seems slightly odd to have 'Server' in there, maybe it should be 
> TSHttpTxnClientAbortGet()?  Not sure how we ended up with the current name...
> 
> -William Bardwell
> 
> {code}
> // Indicates if the connection to the client was aborted,
> // will not be true if the client closed cleanly at the end
> // of the transaction.
> int
> TSHttpTxnServerTransactionClientAbortGet(TSHttpTxn txnp)
> {
>   sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
> 
>   HttpTransact::State *s = &(((HttpSM *) txnp)->t_state);
>   return (s->client_info.abort == HttpTransact::ABORTED);
> }
> {code}
> {code}
> // Indicates if the transaction with the origin server is complete.
> // Will be true if the connection to the origin never started or
> // failed, as well as if it finished successfully.  If this is checked
> // to early or for a cache hit, it will return true.
> int
> TSHttpTxnServerTransactionCompleteGet(TSHttpTxn txnp)
> {
>   sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
> 
>   HttpTransact::State *s = &(((HttpSM *) txnp)->t_state);
>   return ((TSServerState)s->current.state != TS_SRVSTATE_CONNECTION_ALIVE) ||
>     (s->current.server ? (s->current.server->state == 
> HttpTransact::TRANSACTION_COMPLETE):false);
> }
> {code}
> 
> 

Reply via email to