g_free (content);
if (nwritten == -1) {
+ /* do not pass cancellable, the connection is gone or
+ the cancellable cancelled, thus there will be no I/O */
camel_service_disconnect_sync (
- CAMEL_SERVICE (store), FALSE, cancellable, NULL);
+ CAMEL_SERVICE (store), FALSE, NULL, NULL);
return FALSE;
}
if (camel_stream_write (store->ostream, cmd, cmdlen, cancellable, error) == -1 ||
camel_stream_write (store->ostream, "\r\n", 2, cancellable, error) == -1) {
+ /* do not pass cancellable, the connection is gone or
+ the cancellable cancelled, thus there will be no I/O */
camel_service_disconnect_sync (
- CAMEL_SERVICE (store), FALSE, cancellable, NULL);
+ CAMEL_SERVICE (store), FALSE, NULL, NULL);
g_static_rec_mutex_unlock (&store->command_and_response_lock);
return NULL;
}
if (!err || !*err)
err = g_strerror (104);
- /* Connection was lost, no more data to fetch */
+ /* do not pass cancellable, the connection is gone or
+ the cancellable cancelled, thus there will be no I/O */
camel_service_disconnect_sync (
- service, FALSE, cancellable, NULL);
+ service, FALSE, NULL, NULL);
g_set_error (
error, CAMEL_SERVICE_ERROR,
CAMEL_SERVICE_ERROR_UNAVAILABLE,
length - nread,
cancellable, error);
if (n == -1) {
+ /* do not pass cancellable, the connection is gone or
+ the cancellable cancelled, thus there will be no I/O */
camel_service_disconnect_sync (
CAMEL_SERVICE (store),
- FALSE, cancellable, NULL);
+ FALSE, NULL, NULL);
g_string_free (str, TRUE);
goto lose;
}
error, CAMEL_SERVICE_ERROR,
CAMEL_SERVICE_ERROR_UNAVAILABLE,
_("Server response ended too soon."));
+ /* do not pass cancellable, the connection is gone or
+ the cancellable cancelled, thus there will be no I/O */
camel_service_disconnect_sync (
CAMEL_SERVICE (store),
- FALSE, cancellable, NULL);
+ FALSE, NULL, NULL);
g_string_free (str, TRUE);
goto lose;
}
if (!connect_to_server_wrapper (service, cancellable, error) ||
!imap_auth_loop (service, cancellable, error)) {
+ /* reset cancellable, in case it is cancelled,
+ thus the disconnect is run */
+ g_cancellable_reset (cancellable);
camel_service_disconnect_sync (
service, TRUE, cancellable, NULL);
return FALSE;
camel_store_summary_save ((CamelStoreSummary *) store->summary);
if (local_error != NULL) {
+ /* reset cancellable, in case it is cancelled,
+ thus the disconnect is run */
+ g_cancellable_reset (cancellable);
camel_service_disconnect_sync (
service, TRUE, cancellable, NULL);
g_propagate_error (error, local_error);
g_prefix_error (
error, _("Server unexpectedly disconnected: "));
+ /* do not pass cancellable, the connection is gone or
+ the cancellable cancelled, thus there will be no I/O */
camel_service_disconnect_sync (
- CAMEL_SERVICE (store), FALSE, cancellable, NULL);
+ CAMEL_SERVICE (store), FALSE, NULL, NULL);
g_byte_array_free (ba, TRUE);
return -1;
}