diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h b/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h index 756163d..6fbfd44 100644 --- a/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h +++ b/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h @@ -366,7 +366,7 @@ namespace azure { namespace storage { namespace core { // TODO: Reduce usage of auto variable types auto instance = std::make_shared(command, options, context); - return pplx::details::do_while([instance]() -> pplx::task + return details::_do_while([instance]() -> pplx::task { // 0. Begin request instance->validate_location_mode(); diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/util.h b/Microsoft.WindowsAzure.Storage/includes/wascore/util.h index f3401f2..6a6aa48 100644 --- a/Microsoft.WindowsAzure.Storage/includes/wascore/util.h +++ b/Microsoft.WindowsAzure.Storage/includes/wascore/util.h @@ -127,6 +127,21 @@ namespace azure { namespace storage { namespace core { }; #endif + namespace details + { + template + pplx::task _do_while(F func) + { + pplx::task first = func(); + return first.then([=](bool guard) -> pplx::task { + if (guard) + return azure::storage::core::details::_do_while(func); + else + return first; + }); + } + } + }}} // namespace azure::storage::core #pragma pop_macro("max") diff --git a/Microsoft.WindowsAzure.Storage/src/util.cpp b/Microsoft.WindowsAzure.Storage/src/util.cpp index dd2250a..b8d1341 100644 --- a/Microsoft.WindowsAzure.Storage/src/util.cpp +++ b/Microsoft.WindowsAzure.Storage/src/util.cpp @@ -98,7 +98,7 @@ namespace azure { namespace storage { namespace core { auto obuffer = ostream.streambuf(); auto length_ptr = (length != std::numeric_limits::max()) ? std::make_shared(length) : nullptr; auto total_ptr = std::make_shared(0); - return pplx::details::do_while([istream, obuffer, buffer_size, length_ptr, total_ptr, max_length] () -> pplx::task + return azure::storage::core::details::_do_while([istream, obuffer, buffer_size, length_ptr, total_ptr, max_length] () -> pplx::task { size_t read_length = buffer_size; if ((length_ptr != nullptr) && (*length_ptr < read_length))