GNOME Bugzilla – Bug 650671
Service connect/disconnect not cancelled properly
Last modified: 2011-07-01 18:02:26 UTC
When I set my SMTP configuration to use TLS or SSL, sending a mail fails without any proper error. "Sending message..." banner is shown, but nothing happens. Clicking Cancel changes the text, but never actually cancels. Even disconnecting the network isn't enough to cancel the process: I had to close the mail window (probably it continues in the background). We should really get a correct error message, just like this happens with IMAP when TLS isn't supported (which didn't work some time ago, that was bug 436194). If you want to try, the mail server is smtp.sfr.fr.
Oh, and I got a crash when closing Evo that seems to be highly related to SMTP+SSL. Here's the trace: Program terminated with signal 11, Segmentation fault.
+ Trace 227193
Thread 1 (Thread 0x7f620e2fc9a0 (LWP 1815))
Thanks for a bug report. Let's deal with the first issue only, not with the second. I can confirm the issue, I can reproduce it when using TLS on your SMTP server.
Created attachment 191110 [details] [review] eds patch for evolution-data-server; This change is required, because CamelOperation derives from GCancellable, thus one can cancel it by using camel_operation_cancel() or, more often, by g_cancellable_cancel(). Using the former makes the internal CamelMsgPort know about cancellation and everything works as expected, but using the later skips the CamelMsgPort update, thus it doesn't know about the change. This is fixing the issue.
Created attachment 191111 [details] [review] evo patch for evolution; CamelService is using different way for cancelling connect/disconnect. Instead of providing a cancellable as a parameter this is created on demand and used internally, to be able to cancel it by camel_service_cancel() from the offline code. That's what the comment says. I thought I will simply change the API, but after reading that comment I decided to postpone it, instead, I created a wrapper in evolution, to behave like the cancellable is passed into the CamelService. With these two patches I can easily cancel connection any time I want while sending. Not all connect/disconnect are using cancellables, though.
Created commit 89d6972 in eds master (3.1.3+) Created commit 7c6aa94 in evo master (3.1.3+)