aboutsummaryrefslogtreecommitdiff
path: root/plugins/http-files/src/file_sender.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2022-03-30 10:36:52 -0600
committerMarvin W <git@larma.de>2022-03-30 10:36:52 -0600
commit193bf38a790b2a124493c3b7ad591f826e0f773d (patch)
tree2568a9d2d4bad3f0c105a3fa23069a7cf1e56a72 /plugins/http-files/src/file_sender.vala
parent339d1d8f557e88ef6bb5812980b8988dc8fdf10d (diff)
downloaddino-193bf38a790b2a124493c3b7ad591f826e0f773d.tar.gz
dino-193bf38a790b2a124493c3b7ad591f826e0f773d.zip
Allow cancellation of file transfers
Diffstat (limited to 'plugins/http-files/src/file_sender.vala')
-rw-r--r--plugins/http-files/src/file_sender.vala3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/http-files/src/file_sender.vala b/plugins/http-files/src/file_sender.vala
index e005b8c5..8a22ffe1 100644
--- a/plugins/http-files/src/file_sender.vala
+++ b/plugins/http-files/src/file_sender.vala
@@ -98,8 +98,9 @@ public class HttpFileSender : FileSender, Object {
message.wrote_headers.connect(() => transfer_more_bytes(file_transfer.input_stream, message.request_body));
message.wrote_chunk.connect(() => transfer_more_bytes(file_transfer.input_stream, message.request_body));
Soup.Session session = new Soup.Session();
+ session.user_agent = @"Dino/$(Dino.get_short_version()) ";
try {
- yield session.send_async(message);
+ yield session.send_async(message, file_transfer.cancellable);
if (message.status_code < 200 || message.status_code >= 300) {
throw new FileSendError.UPLOAD_FAILED("HTTP status code %s".printf(message.status_code.to_string()));
}