Disable the cancellation callback during shutdown.
Several backends require a shutdown command to be send before closing the connection. If such a command gets cancelled, that might result in an unclean shutdown. Backends where this is problematic can always ignore cancellation requests internally, but it's less error-prone (and much easier) to simply disable the cancellation callback for all backends, before closing the connection.
This commit is contained in:
parent
37cb54c376
commit
888b6ab03f
@ -315,6 +315,10 @@ dc_device_close (dc_device_t *device)
|
||||
if (device->vtable->close == NULL)
|
||||
return DC_STATUS_UNSUPPORTED;
|
||||
|
||||
// Disable the cancellation callback.
|
||||
device->cancel_callback = NULL;
|
||||
device->cancel_userdata = NULL;
|
||||
|
||||
return device->vtable->close (device);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user