Remove AUTHENTICATE-specific parameter and IMAP session code.

This is no longer needed now that AuthenticateCommand takes care of its
own continuations.
This commit is contained in:
Michael James Gratton 2018-07-12 13:53:28 +10:00
parent b74190e010
commit f8e4c2ad93
4 changed files with 0 additions and 90 deletions

View file

@ -293,7 +293,6 @@ src/engine/imap/message/imap-tag.vala
src/engine/imap/message/imap-uid.vala
src/engine/imap/message/imap-uid-validity.vala
src/engine/imap/parameter/imap-atom-parameter.vala
src/engine/imap/parameter/imap-continuation-parameter.vala
src/engine/imap/parameter/imap-list-parameter.vala
src/engine/imap/parameter/imap-literal-parameter.vala
src/engine/imap/parameter/imap-nil-parameter.vala

View file

@ -1,54 +0,0 @@
/*
* Copyright 2018 Michael Gratton <mike@vee.net>
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
/**
* Represents a response to an IMAP continuation request.
*
* Do not use this if you need to send literal data as part of a
* command, add it as a {@link LiteralParameter} to the command
* instead.
*
* See [[http://tools.ietf.org/html/rfc3501#section-7.5]]
*/
public class Geary.Imap.ContinuationParameter : Geary.Imap.Parameter {
private uint8[] data;
/**
* Response to the continuation request.
*
* The given data will be sent to the server as-is. It should not
* contain a trailing EOL.
*/
public ContinuationParameter(uint8[] data) {
this.data = data;
}
public void serialize_continuation(Serializer ser, GLib.Cancellable cancellable)
throws GLib.Error {
ser.push_unquoted_string(
new Memory.ByteBuffer.take(this.data, this.data.length).to_string(),
cancellable
);
ser.push_eol(cancellable);
}
/** {@inheritDoc} */
public override void serialize(Serializer ser, GLib.Cancellable cancellable)
throws GLib.Error {
serialize_continuation(ser, cancellable);
}
/** {@inheritDoc} */
public override string to_string() {
return new Memory.ByteBuffer.take(this.data, this.data.length).to_string();
}
}

View file

@ -202,7 +202,6 @@ public class Geary.Imap.ClientSession : BaseObject {
DISCONNECTED,
RECV_STATUS,
RECV_COMPLETION,
RECV_CONTINUATION,
// I/O errors
RECV_ERROR,
@ -390,7 +389,6 @@ public class Geary.Imap.ClientSession : BaseObject {
new Geary.State.Mapping(State.AUTHORIZING, Event.DISCONNECT, on_disconnect),
new Geary.State.Mapping(State.AUTHORIZING, Event.RECV_STATUS, on_recv_status),
new Geary.State.Mapping(State.AUTHORIZING, Event.RECV_COMPLETION, on_login_recv_completion),
new Geary.State.Mapping(State.AUTHORIZING, Event.RECV_CONTINUATION, on_login_recv_continuation),
new Geary.State.Mapping(State.AUTHORIZING, Event.SEND_ERROR, on_send_error),
new Geary.State.Mapping(State.AUTHORIZING, Event.RECV_ERROR, on_recv_error),
@ -1076,35 +1074,6 @@ public class Geary.Imap.ClientSession : BaseObject {
}
}
private uint on_login_recv_continuation(uint state,
uint event,
void *user,
Object? object) {
ContinuationResponse response = (ContinuationResponse) object;
AuthenticateCommand auth = this.state_change_cmd as AuthenticateCommand;
if (auth != null) {
ContinuationParameter? reply = null;
try {
reply = auth.continuation_requested(response);
} catch (ImapError err) {
debug("[%s] Error handling login continuation request: %s",
to_string(), err.message);
}
if (reply != null) {
// We have to handle the continuation request anyway,
// so just send an empty one.
reply = new ContinuationParameter(new uint8[0]);
}
// XXX Not calling yield here is a nasty hack? Need to get
// a cancellable to this somehow, too.
this.cx.send_continuation_reply.begin(reply, null);
}
return State.AUTHORIZING;
}
//
// keepalives (nop idling to keep the session alive and to periodically receive notifications
// of changes)
@ -1866,8 +1835,6 @@ public class Geary.Imap.ClientSession : BaseObject {
// reschedule keepalive (traffic seen on channel)
schedule_keepalive();
fsm.issue(Event.RECV_CONTINUATION, null, response, null);
}
private void on_received_bytes(size_t bytes) {
@ -1904,4 +1871,3 @@ public class Geary.Imap.ClientSession : BaseObject {
}
}
}

View file

@ -136,7 +136,6 @@ geary_engine_vala_sources = files(
'imap/message/imap-uid.vala',
'imap/message/imap-uid-validity.vala',
'imap/parameter/imap-atom-parameter.vala',
'imap/parameter/imap-continuation-parameter.vala',
'imap/parameter/imap-list-parameter.vala',
'imap/parameter/imap-literal-parameter.vala',
'imap/parameter/imap-nil-parameter.vala',