MINOR: httpclient: stop_and_destroy() ask the applet to autokill

httpclient_stop_and_destroy() tries to destroy the httpclient structure
if the client was stopped.

In the case the client wasn't stopped, it ask the client to stop itself
and to destroy the httpclient structure itself during the release of the
applet.
This commit is contained in:
William Lallemand
2021-09-28 11:00:43 +02:00
parent 739f90a6ef
commit ecb83e13eb
3 changed files with 46 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
#include <haproxy/http_client-t.h>
void httpclient_destroy(struct httpclient *hc);
void httpclient_stop_and_destroy(struct httpclient *hc);
struct httpclient *httpclient_new(void *caller, enum http_meth_t meth, struct ist url);
struct appctx *httpclient_start(struct httpclient *hc);
@@ -20,7 +21,7 @@ static inline int httpclient_data(struct httpclient *hc)
/* Return 1 if the httpclient ended and won't receive any new data */
static inline int httpclient_ended(struct httpclient *hc)
{
return !!(hc->flags & HTTPCLIENT_F_ENDED);
return !!(hc->flags & HTTPCLIENT_FS_ENDED);
}
#endif /* ! _HAPROXY_HTTCLIENT_H */