mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
fix(mbuild): upload size now taken properly
Previously, it would query the size from the wrong dict and obtain the value 0 all the time. This would have made every upload fail with `UploadSizeLimitExeeded`. Now we obtain the actual size limit, and will ignore it if unset/0 for some reason. Patch += 1
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// This file was generated automatically from 'src/mako/lib.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
|
||||
//! This documentation was generated from *Groups Migration* crate version *0.1.0+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.0*.
|
||||
//! This documentation was generated from *Groups Migration* crate version *0.1.1+20140416*, where *20140416* is the exact revision of the *groupsmigration:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.1*.
|
||||
//!
|
||||
//! Everything else about the *Groups Migration* *v1* API can be found at the
|
||||
//! [official documentation site](https://developers.google.com/google-apps/groups-migration/).
|
||||
@@ -293,7 +293,7 @@ impl<'a, C, NC, A> GroupsMigration<C, NC, A>
|
||||
GroupsMigration {
|
||||
client: RefCell::new(client),
|
||||
auth: RefCell::new(authenticator),
|
||||
_user_agent: "google-api-rust-client/0.1.0".to_string(),
|
||||
_user_agent: "google-api-rust-client/0.1.1".to_string(),
|
||||
_m: PhantomData
|
||||
}
|
||||
}
|
||||
@@ -303,7 +303,7 @@ impl<'a, C, NC, A> GroupsMigration<C, NC, A>
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/0.1.0`.
|
||||
/// It defaults to `google-api-rust-client/0.1.1`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
@@ -554,8 +554,8 @@ impl<'a, C, NC, A> ArchiveInsertCall<'a, C, NC, A> where NC: hyper::net::Network
|
||||
if protocol == "simple" {
|
||||
let size = reader.seek(io::SeekFrom::End(0)).unwrap();
|
||||
reader.seek(io::SeekFrom::Start(0)).unwrap();
|
||||
if size > 0 {
|
||||
return Result::UploadSizeLimitExceeded(size, 0)
|
||||
if size > 16777216 {
|
||||
return Result::UploadSizeLimitExceeded(size, 16777216)
|
||||
}
|
||||
req = req.header(ContentType(reader_mime_type.clone()))
|
||||
.header(ContentLength(size))
|
||||
@@ -595,8 +595,8 @@ impl<'a, C, NC, A> ArchiveInsertCall<'a, C, NC, A> where NC: hyper::net::Network
|
||||
if protocol == "resumable" {
|
||||
let size = reader.seek(io::SeekFrom::End(0)).unwrap();
|
||||
reader.seek(io::SeekFrom::Start(0)).unwrap();
|
||||
if size > 0 {
|
||||
return Result::UploadSizeLimitExceeded(size, 0)
|
||||
if size > 16777216 {
|
||||
return Result::UploadSizeLimitExceeded(size, 16777216)
|
||||
}
|
||||
let mut client = &mut *self.hub.client.borrow_mut();
|
||||
let upload_result = {
|
||||
|
||||
Reference in New Issue
Block a user