You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Leif Hedstrom <zw...@apache.org> on 2010/11/18 04:26:51 UTC

Transaction and Session "private" data for plugins

Hi all,

There are currently two APIs for setting / getting "private" data for a 
transaction, that can be shared across different plugins (for example). 
I'm proposing some changes and additions to these APIs (see abbreviated 
diff below for the include file). In short, I'm proposing

1) We change the names to be more in line with other getter / setter API 
naming conventions in ts/ts.h i.e. . ...Get() and ...Set()

2) We add an API to allow a plugin to "reserve" a slot for the private 
data. This reserved index applies to both transaction and session data, 
and is later used to Set() or Get() the data (just as the old APIs index).

3) We add an API to do lookups on currently reserved slots (by name). 
This allows one plugin to easily find data owned by another plugin 
(assuming they both know what to do with it).


Unless I hear otherwise, I will commit these changes Thursday or Friday. 
Jira tickets are TS-504 and TS-503 (with comments).

Cheers,

-- Leif

-  tsapi int TSHttpTxnGetMaxArgCnt(void);
-  tsapi TSReturnCode TSHttpTxnSetArg(TSHttpTxn txnp, int arg_idx, void 
*arg);
-  tsapi TSReturnCode TSHttpTxnGetArg(TSHttpTxn txnp, int arg_idx, void 
**arg);
+
+  /** @deprecated */
+  tsapi TS_DEPRECATED int TSHttpTxnMaxArgCntGet(void);
+
+  tsapi TSReturnCode TSHttpTxnArgSet(TSHttpTxn txnp, int arg_idx, void 
*arg);
+  tsapi TSReturnCode TSHttpTxnArgGet(TSHttpTxn txnp, int arg_idx, void 
**arg);
+  tsapi TSReturnCode TSHttpSsnArgSet(TSHttpSsn ssnp, int arg_idx, void 
*arg);
+  tsapi TSReturnCode TSHttpSsnArgGet(TSHttpSsn ssnp, int arg_idx, void 
**arg);

+  tsapi int TSHttpArgIndexReserve(const char* name, const char* 
description);
+  tsapi int TSHttpArgIndexLookup(const char* name);

Re: Transaction and Session "private" data for plugins

Posted by "Alan M. Carroll" <am...@network-geographics.com>.
Looks good to me.

Wednesday, November 17, 2010, 9:26:51 PM, you wrote:

> Hi all,

> There are currently two APIs for setting / getting "private" data for a 
> transaction, that can be shared across different plugins (for example). 
> I'm proposing some changes and additions to these APIs (see abbreviated 
> diff below for the include file).