const char *errstr;
if (cmd->client->output->closed) {
- client_disconnect(cmd->client, NULL);
- return TRUE;
+ /* If we're canceling we need to finish this command
+ or we'll assert crash. But normally we want to
+ return FALSE so that the disconnect message logs
+ about this fetch command and that these latest
+ output bytes are included in it (which wouldn't
+ happen if we called client_disconnect() here
+ directly). */
+ return cmd->cancel;
}
errstr = mailbox_get_last_error(cmd->client->mailbox, &error);
o_stream_uncork(client->output);
imap_refresh_proctitle();
- if (client->disconnected)
+ if (client->output->closed)
client_destroy(client, NULL);
else
client_continue_pending_input(client);