Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 658b418

Browse files
katmsftvinjiang
authored andcommitted
Resolved a bug where user setting file size larger than maximum quota wouldn't fail.
1 parent ee3a3f7 commit 658b418

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

Microsoft.WindowsAzure.Storage/includes/wascore/constants.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ namespace azure { namespace storage { namespace protocol {
5858
const std::chrono::seconds minimum_fixed_lease_duration(15);
5959
const std::chrono::seconds maximum_fixed_lease_duration(60);
6060

61-
// could file share limitation
62-
const int maximum_share_quota(5120);
63-
6461
#define _CONSTANTS
6562
#define DAT(a, b) WASTORAGE_API extern const utility::char_t a[]; const size_t a ## _size = sizeof(b) / sizeof(utility::char_t) - 1;
6663
#include "constants.dat"

Microsoft.WindowsAzure.Storage/includes/wascore/protocol_xml.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ namespace azure { namespace storage { namespace protocol {
702702
public:
703703

704704
explicit get_share_stats_reader(concurrency::streams::istream stream)
705-
: xml_reader(stream), m_quota(maximum_share_quota)
705+
: xml_reader(stream), m_quota(std::numeric_limits<unsigned long long>::max())
706706
{
707707
}
708708

Microsoft.WindowsAzure.Storage/src/cloud_file_share.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace azure { namespace storage {
8484

8585
pplx::task<void> cloud_file_share::create_async(const file_request_options& options, operation_context context)
8686
{
87-
return create_async(protocol::maximum_share_quota, options, context);
87+
return create_async(std::numeric_limits<unsigned long long>::max(), options, context);
8888
}
8989

9090
pplx::task<void> cloud_file_share::create_async(utility::size64_t max_size, const file_request_options& options, operation_context context)
@@ -107,7 +107,7 @@ namespace azure { namespace storage {
107107

108108
pplx::task<bool> cloud_file_share::create_if_not_exists_async(const file_request_options& options, operation_context context)
109109
{
110-
return create_if_not_exists_async(protocol::maximum_share_quota, options, context);
110+
return create_if_not_exists_async(std::numeric_limits<unsigned long long>::max(), options, context);
111111
}
112112

113113
pplx::task<bool> cloud_file_share::create_if_not_exists_async(utility::size64_t max_size, const file_request_options& options, operation_context context)

Microsoft.WindowsAzure.Storage/src/file_request_factory.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ namespace azure { namespace storage { namespace protocol {
279279
uri_builder.append_query(core::make_query_parameter(uri_query_resource_type, resource_share, /* do_encoding */ false));
280280
web::http::http_request request(base_request(web::http::methods::PUT, uri_builder, timeout, context));
281281
web::http::http_headers& headers = request.headers();
282-
if (max_size <= maximum_share_quota)
282+
if (max_size != std::numeric_limits<unsigned long long>::max())
283283
{
284284
headers.add(protocol::ms_header_share_quota, max_size);
285285
}
@@ -305,10 +305,7 @@ namespace azure { namespace storage { namespace protocol {
305305
uri_builder.append_query(core::make_query_parameter(uri_query_resource_type, resource_share, /* do_encoding */ false));
306306
uri_builder.append_query(core::make_query_parameter(uri_query_component, component_properties, /* do_encoding */ false));
307307
web::http::http_request request(base_request(web::http::methods::PUT, uri_builder, timeout, context));
308-
if (properties.quota() <= protocol::maximum_share_quota)
309-
{
310-
request.headers().add(protocol::ms_header_share_quota, properties.quota());
311-
}
308+
request.headers().add(protocol::ms_header_share_quota, properties.quota());
312309
return request;
313310
}
314311

0 commit comments

Comments
 (0)