[
https://issues.apache.org/jira/browse/TS-4555?focusedWorklogId=28750&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-28750
]
ASF GitHub Bot logged work on TS-4555:
--------------------------------------
Author: ASF GitHub Bot
Created on: 11/Sep/16 20:45
Start Date: 11/Sep/16 20:45
Worklog Time Spent: 10m
Work Description: Github user SolidWallOfCode commented on a diff in the
pull request:
https://github.com/apache/trafficserver/pull/967#discussion_r78302162
--- Diff: lib/atscppapi/src/utils_internal.cc ---
@@ -99,6 +97,8 @@ handleTransactionEvents(TSCont cont, TSEvent event, void
*edata)
void
setupTransactionManagement()
{
+ // Reserve a transaction slot
+ TSAssert(TS_SUCCESS == TSHttpArgIndexReserve("atscppapi", "ATS CPP API",
&TRANSACTION_STORAGE_INDEX));
--- End diff --
I think the problem with `GlobalPlugin::GlobalPlugin` is it can be called
multiple times, once for each global plugin defined. I think only one
transaction arg is required, though, for all global plugins.
Issue Time Tracking
-------------------
Worklog Id: (was: 28750)
Time Spent: 1h (was: 50m)
> C++ API takes a transaction argument without allocating it
> ----------------------------------------------------------
>
> Key: TS-4555
> URL: https://issues.apache.org/jira/browse/TS-4555
> Project: Traffic Server
> Issue Type: Bug
> Components: CPP API
> Reporter: James Peach
> Assignee: Alan M. Carroll
> Fix For: 7.0.0
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> {code}
> Transaction &
> utils::internal::getTransaction(TSHttpTxn ats_txn_handle)
> {
> Transaction *transaction = static_cast<Transaction
> *>(TSHttpTxnArgGet(ats_txn_handle, TRANSACTION_STORAGE_INDEX));
> if (!transaction) {
> transaction = new Transaction(static_cast<void *>(ats_txn_handle));
> LOG_DEBUG("Created new transaction object at %p for ats pointer %p",
> transaction, ats_txn_handle);
> TSHttpTxnArgSet(ats_txn_handle, TRANSACTION_STORAGE_INDEX, transaction);
> }
> return *transaction;
> }
> {code}
> {{TRANSACTION_STORAGE_INDEX}} is hardcoded constant that is not allocated by
> {{TSHttpArgIndexReserve}}, so it is subject to collisions with other plugins.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)