mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:41:40 +03:00
smtp: add tracing feature
Add `smtp` as tracing feature, use CURL_TRC_SMTP() in code to trace operations. Closes #14531
This commit is contained in:
parent
8058bbae52
commit
1c42ea4066
4 changed files with 61 additions and 14 deletions
|
|
@ -221,6 +221,24 @@ void Curl_trc_ftp(struct Curl_easy *data, const char *fmt, ...)
|
|||
}
|
||||
#endif /* !CURL_DISABLE_FTP */
|
||||
|
||||
#ifndef CURL_DISABLE_SMTP
|
||||
struct curl_trc_feat Curl_trc_feat_smtp = {
|
||||
"SMTP",
|
||||
CURL_LOG_LVL_NONE,
|
||||
};
|
||||
|
||||
void Curl_trc_smtp(struct Curl_easy *data, const char *fmt, ...)
|
||||
{
|
||||
DEBUGASSERT(!strchr(fmt, '\n'));
|
||||
if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_smtp)) {
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
trc_infof(data, &Curl_trc_feat_smtp, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
#endif /* !CURL_DISABLE_SMTP */
|
||||
|
||||
#if defined(USE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
|
||||
struct curl_trc_feat Curl_trc_feat_ws = {
|
||||
"WS",
|
||||
|
|
@ -258,6 +276,9 @@ static struct trc_feat_def trc_feats[] = {
|
|||
#ifndef CURL_DISABLE_DOH
|
||||
{ &Curl_doh_trc, TRC_CT_NETWORK },
|
||||
#endif
|
||||
#ifndef CURL_DISABLE_SMTP
|
||||
{ &Curl_trc_feat_smtp, TRC_CT_PROTOCOL },
|
||||
#endif
|
||||
#if defined(USE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
|
||||
{ &Curl_trc_feat_ws, TRC_CT_PROTOCOL },
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue