[
https://issues.apache.org/jira/browse/TS-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yunkai Zhang updated TS-977:
----------------------------
Attachment: 0003-TS-977-Fix-RecMessageSend-regression.patch
Fix RecMessageSend regression caused by
0001-RecCore-refine-P_RecCore.i-and-rename-it-to-P_RecCor.patch.
> RecCore usage cleanup
> ---------------------
>
> Key: TS-977
> URL: https://issues.apache.org/jira/browse/TS-977
> Project: Traffic Server
> Issue Type: Task
> Components: Cleanup
> Reporter: Zhao Yongming
> Assignee: Zhao Yongming
> Priority: Minor
> Fix For: 3.3.1
>
> Attachments:
> 0001-RecCore-refine-P_RecCore.i-and-rename-it-to-P_RecCor.patch,
> 0002-RecCore-remove-unnecessary-IOCORE_-wrapper-on-RecCor.patch,
> 0003-TS-977-Fix-RecMessageSend-regression.patch
>
>
> in RecCore.*
> {code}
> int RecGetRecordInt(const char *name, RecInt * rec_int, bool lock = true);
> //-------------------------------------------------------------------------
> // RecGetRecordXXX
> //-------------------------------------------------------------------------
> int
> RecGetRecordInt(const char *name, RecInt *rec_int, bool lock)
> {
> int err;
> RecData data;
> if ((err = RecGetRecord_Xmalloc(name, RECD_INT, &data, lock)) ==
> REC_ERR_OKAY)
> *rec_int = data.rec_int;
> return err;
> }
> {code}
> and there is something heavy used:
> {code}
> //-------------------------------------------------------------------------
> // Backwards Compatibility Items (REC_ prefix)
> //-------------------------------------------------------------------------
> #define REC_ReadConfigInt32(_var,_config_var_name) do { \
> RecInt tmp = 0; \
> RecGetRecordInt(_config_var_name, (RecInt*) &tmp); \
> _var = (int32_t)tmp; \
> } while (0)
> #define REC_ReadConfigInteger(_var,_config_var_name) do { \
> RecInt tmp = 0; \
> RecGetRecordInt(_config_var_name, &tmp); \
> _var = tmp; \
> } while (0)
> {code}
> and a real case, the REC_ReadConfigInteger is renamed to
> IOCORE_ReadConfigInteger:
> {code}
> RecInt cache_config_threads_per_disk = 12;
> #define IOCORE_ReadConfigInteger REC_ReadConfigInteger
> IOCORE_ReadConfigInteger(cache_config_threads_per_disk,
> "proxy.config.cache.threads_per_disk");
> {code}
> my question is, why it is so complex in all these renaming? why not just:
> {code}
> RecGetRecordInt("proxy.config.cache.threads_per_disk",
> &cache_config_threads_per_disk);
> {code}
> brief talk with Leif, we may need to cleanup the use of REC_*. make it a
> small task here
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira