mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
MINOR: proxy: add deinit_proxy() helper func
Same as free_proxy(), but does not free the base proxy pointer (ie: the proxy itself may not be allocated) Goal is to be able to cleanup statically allocated dummy proxies.
This commit is contained in:
parent
4194f756de
commit
fbfeb591f7
@ -51,6 +51,7 @@ int resume_proxy(struct proxy *p);
|
||||
void stop_proxy(struct proxy *p);
|
||||
int stream_set_backend(struct stream *s, struct proxy *be);
|
||||
|
||||
void deinit_proxy(struct proxy *p);
|
||||
void free_proxy(struct proxy *p);
|
||||
const char *proxy_cap_str(int cap);
|
||||
const char *proxy_mode_str(int mode);
|
||||
|
11
src/proxy.c
11
src/proxy.c
@ -284,7 +284,10 @@ static inline void proxy_free_common(struct proxy *px)
|
||||
px->uri_auth = NULL;
|
||||
}
|
||||
|
||||
void free_proxy(struct proxy *p)
|
||||
/* deinit all <p> proxy members, but doesn't touch to the parent pointer
|
||||
* itself
|
||||
*/
|
||||
void deinit_proxy(struct proxy *p)
|
||||
{
|
||||
struct server *s;
|
||||
struct cap_hdr *h,*h_next;
|
||||
@ -424,6 +427,12 @@ void free_proxy(struct proxy *p)
|
||||
HA_RWLOCK_DESTROY(&p->lock);
|
||||
|
||||
proxy_unref_defaults(p);
|
||||
}
|
||||
|
||||
/* deinit and free <p> proxy */
|
||||
void free_proxy(struct proxy *p)
|
||||
{
|
||||
deinit_proxy(p);
|
||||
ha_free(&p);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user