mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-17 19:16:56 +00:00
MINOR: httpclient: destroy checks if a client was started but not stopped
During httpclient_destroy, add a condition in the BUG_ON which checks that the client was started before it has ended. A httpclient structure could have been created without being started.
This commit is contained in:
parent
4d60184887
commit
2a879001b5
@ -24,4 +24,11 @@ static inline int httpclient_ended(struct httpclient *hc)
|
||||
return !!(hc->flags & HTTPCLIENT_FS_ENDED);
|
||||
}
|
||||
|
||||
/* Return 1 if the httpclient started */
|
||||
static inline int httpclient_started(struct httpclient *hc)
|
||||
{
|
||||
|
||||
return !!(hc->flags & HTTPCLIENT_FS_STARTED);
|
||||
}
|
||||
|
||||
#endif /* ! _HAPROXY_HTTCLIENT_H */
|
||||
|
@ -438,8 +438,8 @@ void httpclient_destroy(struct httpclient *hc)
|
||||
if (!hc)
|
||||
return;
|
||||
|
||||
/* we should never destroy a client which was not stopped */
|
||||
BUG_ON(!httpclient_ended(hc));
|
||||
/* we should never destroy a client which was started but not stopped */
|
||||
BUG_ON(httpclient_started(hc) && !httpclient_ended(hc));
|
||||
|
||||
/* request */
|
||||
istfree(&hc->req.url);
|
||||
|
Loading…
Reference in New Issue
Block a user