feat(cmn): implement query_transfer_status()

The delegate logic is implemented and seems sound.
It's somewhat funny that after all this back and forth, all we get
is a valid start position for the upload.
This commit is contained in:
Sebastian Thiel
2015-03-22 17:58:34 +01:00
parent 42a76e4655
commit 065753cc3a
5 changed files with 238 additions and 73 deletions

View File

@@ -765,7 +765,7 @@ else {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
let error_info: cmn::JsonServerError = json::from_str(&json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, error_info) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res, Some(error_info)) {
sleep(d);
continue;
}
@@ -785,6 +785,7 @@ else {
cmn::ResumableUploadHelper {
client: &mut client.borrow_mut(),
delegate: dlg,
start_at: if upload_url_from_server { Some(0) } else { None },
auth: &mut *self.hub.auth.borrow_mut(),
user_agent: &self.hub._user_agent,
auth_header: auth_header.clone(),