[geary/wip/543-append-failure: 2/3] Convert Imap.Serialiser.push_literal_data to take generic param
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/543-append-failure: 2/3] Convert Imap.Serialiser.push_literal_data to take generic param
- Date: Thu, 29 Aug 2019 13:27:59 +0000 (UTC)
commit 4c56ff34369f756a120631368280a1bbf7b2087e
Author: Michael Gratton <mike vee net>
Date: Thu Aug 29 23:11:32 2019 +1000
Convert Imap.Serialiser.push_literal_data to take generic param
Rather than taking a Literal argument, take a data array instead. This
allows more flexibility in sending literal data to the server.
src/engine/imap/command/imap-authenticate-command.vala | 2 +-
src/engine/imap/command/imap-command.vala | 4 +++-
src/engine/imap/transport/imap-serializer.vala | 10 +++++-----
3 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/engine/imap/command/imap-authenticate-command.vala
b/src/engine/imap/command/imap-authenticate-command.vala
index c3dfa694..041de90e 100644
--- a/src/engine/imap/command/imap-authenticate-command.vala
+++ b/src/engine/imap/command/imap-authenticate-command.vala
@@ -65,7 +65,7 @@ public class Geary.Imap.AuthenticateCommand : Command {
yield this.error_lock.wait_async(cancellable);
if (this.response_literal != null) {
yield ser.push_literal_data(
- this.response_literal.value, cancellable
+ this.response_literal.value.get_uint8_array(), cancellable
);
ser.push_eol(cancellable);
yield ser.flush_stream(cancellable);
diff --git a/src/engine/imap/command/imap-command.vala b/src/engine/imap/command/imap-command.vala
index 324538e1..361bbca1 100644
--- a/src/engine/imap/command/imap-command.vala
+++ b/src/engine/imap/command/imap-command.vala
@@ -178,7 +178,9 @@ public class Geary.Imap.Command : BaseObject {
// Will get notified via continuation_requested
// when server indicated the literal can be sent.
yield this.literal_spinlock.wait_async(cancellable);
- yield ser.push_literal_data(literal.value, cancellable);
+ yield ser.push_literal_data(
+ literal.value.get_uint8_array(), cancellable
+ );
}
}
}
diff --git a/src/engine/imap/transport/imap-serializer.vala b/src/engine/imap/transport/imap-serializer.vala
index 2df8b484..36dafca9 100644
--- a/src/engine/imap/transport/imap-serializer.vala
+++ b/src/engine/imap/transport/imap-serializer.vala
@@ -103,14 +103,14 @@ public class Geary.Imap.Serializer : BaseObject {
/**
* Writes literal data to the output stream.
*/
- public async void push_literal_data(Memory.Buffer buffer,
+ public async void push_literal_data(uint8[] buffer,
GLib.Cancellable? cancellable = null)
throws GLib.Error {
- yield this.output.splice_async(
- buffer.get_input_stream(),
- OutputStreamSpliceFlags.NONE,
+ yield this.output.write_all_async(
+ buffer,
Priority.DEFAULT,
- cancellable
+ cancellable,
+ null
);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]