fix(API): let delegate forget uploaded urls

When uploading using the resumable protocol, we are now telling the
delegate to forget the previously stored URL after successful upload.
Previously it would have tried to return such a URL and thus made
the system retry uploading a file that was already uploaded.

Fixes #85
[skip ci]
This commit is contained in:
Sebastian Thiel
2015-05-01 16:24:21 +02:00
parent d8acd607ae
commit c346645fc9
2 changed files with 6 additions and 2 deletions

View File

@@ -171,7 +171,10 @@ pub trait Delegate {
/// Called after we have retrieved a new upload URL for a resumable upload to store it
/// in case we fail or cancel. That way, we can attempt to resume the upload later,
/// see `upload_url()`.
fn store_upload_url(&mut self, url: &str) {
/// It will also be called with None after a successful upload, which allows the delegate
/// to forget the URL. That way, we will not attempt to resume an upload that has already
/// finished.
fn store_upload_url(&mut self, url: Option<&str>) {
let _ = url;
}