Geary.Imap.Command: Rename cancel_send to something that better describes it
This method doesn't cancel sending as much as it halts any serialisation that is occurring.
This commit is contained in:
parent
0707500561
commit
6c0607d809
3 changed files with 13 additions and 13 deletions
|
|
@ -93,7 +93,7 @@ public class Geary.Imap.AuthenticateCommand : Command {
|
|||
} else {
|
||||
if (this.method != AuthenticateCommand.OAUTH2_METHOD ||
|
||||
this.response_literal != null) {
|
||||
cancel_send();
|
||||
stop_serialisation();
|
||||
throw new ImapError.INVALID(
|
||||
"Unexpected AUTHENTICATE continuation request"
|
||||
);
|
||||
|
|
@ -112,8 +112,8 @@ public class Geary.Imap.AuthenticateCommand : Command {
|
|||
}
|
||||
}
|
||||
|
||||
protected override void cancel_send() {
|
||||
base.cancel_send();
|
||||
protected override void stop_serialisation() {
|
||||
base.stop_serialisation();
|
||||
this.error_cancellable.cancel();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ public abstract class Geary.Imap.Command : BaseObject {
|
|||
internal virtual void completed(StatusResponse new_status)
|
||||
throws ImapError {
|
||||
if (this.status != null) {
|
||||
cancel_send();
|
||||
stop_serialisation();
|
||||
throw new ImapError.SERVER_ERROR(
|
||||
"%s: Duplicate status response received: %s",
|
||||
to_brief_string(),
|
||||
|
|
@ -326,7 +326,7 @@ public abstract class Geary.Imap.Command : BaseObject {
|
|||
this.status = new_status;
|
||||
this.response_timer.reset();
|
||||
this.complete_lock.blind_notify();
|
||||
cancel_send();
|
||||
stop_serialisation();
|
||||
|
||||
check_has_status();
|
||||
}
|
||||
|
|
@ -348,7 +348,7 @@ public abstract class Geary.Imap.Command : BaseObject {
|
|||
internal virtual void data_received(ServerData data)
|
||||
throws ImapError {
|
||||
if (this.status != null) {
|
||||
cancel_send();
|
||||
stop_serialisation();
|
||||
throw new ImapError.SERVER_ERROR(
|
||||
"%s: Server data received when command already complete: %s",
|
||||
to_brief_string(),
|
||||
|
|
@ -370,7 +370,7 @@ public abstract class Geary.Imap.Command : BaseObject {
|
|||
continuation_requested(ContinuationResponse continuation)
|
||||
throws ImapError {
|
||||
if (this.status != null) {
|
||||
cancel_send();
|
||||
stop_serialisation();
|
||||
throw new ImapError.SERVER_ERROR(
|
||||
"%s: Continuation requested when command already complete",
|
||||
to_brief_string()
|
||||
|
|
@ -378,7 +378,7 @@ public abstract class Geary.Imap.Command : BaseObject {
|
|||
}
|
||||
|
||||
if (this.literal_spinlock == null) {
|
||||
cancel_send();
|
||||
stop_serialisation();
|
||||
throw new ImapError.SERVER_ERROR(
|
||||
"%s: Continuation requested but no literals available",
|
||||
to_brief_string()
|
||||
|
|
@ -395,19 +395,19 @@ public abstract class Geary.Imap.Command : BaseObject {
|
|||
}
|
||||
|
||||
/**
|
||||
* Cancels any existing serialisation in progress.
|
||||
* Stops any existing serialisation in progress.
|
||||
*
|
||||
* When this method is called, any non I/O related process
|
||||
* blocking the blocking {@link send} must be cancelled.
|
||||
*/
|
||||
protected virtual void cancel_send() {
|
||||
protected virtual void stop_serialisation() {
|
||||
if (this.literal_cancellable != null) {
|
||||
this.literal_cancellable.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
private void cancel(ImapError cause) {
|
||||
cancel_send();
|
||||
stop_serialisation();
|
||||
this.cancelled_cause = cause;
|
||||
this.response_timer.reset();
|
||||
this.complete_lock.blind_notify();
|
||||
|
|
|
|||
|
|
@ -88,8 +88,8 @@ public class Geary.Imap.IdleCommand : Command {
|
|||
}
|
||||
}
|
||||
|
||||
protected override void cancel_send() {
|
||||
base.cancel_send();
|
||||
protected override void stop_serialisation() {
|
||||
base.stop_serialisation();
|
||||
this.exit_cancellable.cancel();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue