mirror of
https://github.com/haproxy/haproxy.git
synced 2026-03-14 14:42:13 -04:00
MINOR: ssl: set the thread execution context during message callbacks
In order to be able to track memory allocation performed from message callbacks, let's set the thread execution context to a generic function pointing to them during their call. This allows for example to observe the share of SSL allocations caused by ssl_sock_parse_clienthello() when SSL captures are enabled. The release calls are automatic from the SSL library for these, and are registered directly via SSL_get_ex_new_index(). Maybe we should improve the internal API to wrap that function and systematically track free calls as well. In this case, maybe even registering the message callback registration could take both the callback and the release function. There are few such users however, essentially capture and keylog.
This commit is contained in:
parent
3fb8659d04
commit
e8e4449985
1 changed files with 2 additions and 1 deletions
|
|
@ -2177,7 +2177,8 @@ static __maybe_unused void ssl_sock_msgcbk(int write_p, int version, int content
|
|||
* ssl_sock_register_msg_callback().
|
||||
*/
|
||||
list_for_each_entry(cbk, &ssl_sock_msg_callbacks, list) {
|
||||
cbk->func(write_p, version, content_type, buf, len, ssl);
|
||||
EXEC_CTX_NO_RET(EXEC_CTX_MAKE(TH_EX_CTX_FUNC, cbk->func),
|
||||
cbk->func(write_p, version, content_type, buf, len, ssl));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue