From df13f8e8c2199b572f19d295e5c59e7502204b3a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 20 May 2014 10:32:23 +0200 Subject: bits.close: introduce connection close tracking Make all code use connclose() and connkeep() when changing the "close state" for a connection. These two macros take a string argument with an explanation, and debug builds of curl will include that in the debug output. Helps tracking connection re-use/close issues. --- lib/smtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/smtp.c') diff --git a/lib/smtp.c b/lib/smtp.c index 762a8d16a..5938c3ff4 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1588,7 +1588,7 @@ static CURLcode smtp_connect(struct connectdata *conn, bool *done) *done = FALSE; /* default to not done yet */ /* We always support persistent connections in SMTP */ - conn->bits.close = FALSE; + connkeep(conn, "SMTP default"); /* Set the default response time-out */ pp->response_time = RESP_TIMEOUT; @@ -1650,7 +1650,7 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status, return CURLE_OK; if(status) { - conn->bits.close = TRUE; /* marked for closure */ + connclose(conn, "SMTP done with bad status"); /* marked for closure */ result = status; /* use the already set error code */ } else if(!data->set.connect_only && data->set.upload && data->set.mail_rcpt) { -- cgit v1.2.3