As far as I understand the code, smtp_easy_statemach function enters an endless while-loop in this case: Curl_pp_easy_statemach returns 0 (as select() has timedout). Maybe CURLE_OPERATION_TIMEDOUT should be returned here.
Is it the correct solution?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You're completely right.
What I see is that no status information is propagated to the Curl_disconnect function.Should the connection be marked as premature=TRUE if status==ABORT?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've pushed a fix to git just now, commit 72688317adcedb9508fd2. It is slightly different than yours but similar. I've also added test case 1507 that I've used to verify the fix.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As far as I understand the code, smtp_easy_statemach function enters an endless while-loop in this case: Curl_pp_easy_statemach returns 0 (as select() has timedout). Maybe CURLE_OPERATION_TIMEDOUT should be returned here.
Is it the correct solution?
If the callback has returned ABORT then it shouldn't call select at all. Or am I misunderstanding something?
You're completely right.
What I see is that no status information is propagated to the Curl_disconnect function.Should the connection be marked as premature=TRUE if status==ABORT?
The following patch seems to solve the problem. Could you have a look at the patch? Thanks.
diff --git a/lib/url.c b/lib/url.c
index 80c8a997e39891d567a71d7d77bc8de62bf7e25b..40b420b0821804c23b9eaaa2798fe58a3692d582 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -5174,7 +5174,12 @@ CURLcode Curl_done(struct connectdata connp,
/
if(data->set.reuse_forbid || conn->bits.close || premature ||
(-1 == conn->connection_id)) {
- CURLcode res2 = Curl_disconnect(conn, premature); / close connection /
+ CURLcode res2;
+
+ if(status == CURLE_ABORTED_BY_CALLBACK)
+ premature = TRUE;
+
+ res2 = Curl_disconnect(conn, premature); / close connection */
Hello, I wonder if the suggested patch is the correct one. Thank you!
I used doc/examples/smtp-multi.c to reproduce the problem.
thanks a lot for your report and work.
I've pushed a fix to git just now, commit 72688317adcedb9508fd2. It is slightly different than yours but similar. I've also added test case 1507 that I've used to verify the fix.
Thank you!