diff options
author | Marvin W <git@larma.de> | 2022-03-30 10:36:52 -0600 |
---|---|---|
committer | Marvin W <git@larma.de> | 2022-03-30 10:36:52 -0600 |
commit | 193bf38a790b2a124493c3b7ad591f826e0f773d (patch) | |
tree | 2568a9d2d4bad3f0c105a3fa23069a7cf1e56a72 /plugins/http-files/src/file_sender.vala | |
parent | 339d1d8f557e88ef6bb5812980b8988dc8fdf10d (diff) | |
download | dino-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.vala | 3 |
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())); } |