mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
BUILD: applet: mark the CLI's generic variables as deprecated
The generic context variables p0/p1/p2, i0/i1, o0/o1 have been abused and causing trouble for too long, it's time to remove them now that they are not used anymore. However the risk that external code still uses them is not nul and we had not warned before about their removal. Let's mark them deprecated in 2.6 and removed in 2.7. This will let external code continue to work (as well as it could if it misuses them), with a strong encouragement on updating it. If you found this commit after a bisect session you initiated to figure why you got some build warnings and don't know what to do, have a look at the code that deals with the "show fd", "show env" or "show servers" commands, as it's supposed to be self-explanatory about the tiny changes to apply to your code to port it. If you find APPLET_MAX_SVCCTX to be too small for your use case, either kindly ask for a tiny extension (and try to get your code merged), or just use a pool.
This commit is contained in:
parent
23a2407843
commit
f50da2c320
@ -115,9 +115,14 @@ struct appctx {
|
||||
const char *msg; /* pointer to a persistent message to be returned in CLI_ST_PRINT state */
|
||||
int severity; /* severity of the message to be returned according to (syslog) rfc5424 */
|
||||
char *err; /* pointer to a 'must free' message to be returned in CLI_ST_PRINT_FREE state */
|
||||
void *p0, *p1, *p2; /* ...registered commands, initialized to 0 by the CLI before first... */
|
||||
size_t o0, o1; /* ...invocation of the keyword parser, except for the list element which... */
|
||||
int i0, i1; /* ...is initialized with LIST_INIT(). */
|
||||
/* WARNING: the entries below are only kept for compatibility
|
||||
* with possible external code but will disappear in 2.7, you
|
||||
* must use the cleaner svcctx now (look at "show fd" for an
|
||||
* example).
|
||||
*/
|
||||
__attribute__((deprecated)) void *p0, *p1, *p2;
|
||||
__attribute__((deprecated)) size_t o0, o1;
|
||||
__attribute__((deprecated)) int i0, i1;
|
||||
} cli; /* context used by the CLI */
|
||||
struct {
|
||||
struct cache_entry *entry; /* Entry to be sent from cache. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user