diff --git a/BreakingChanges.txt b/BreakingChanges.txt index 864ff225..86da6225 100644 --- a/BreakingChanges.txt +++ b/BreakingChanges.txt @@ -1,6 +1,9 @@ Azure Storage Client Library for C++ History of Breaking Changes +Breaking Changes in v2.5: +- Upgraded Casablanca dependency to 2.9.1 + Breaking Changes in v2.3: - Upgraded Casablanca dependency to 2.8.0 diff --git a/Changelog.txt b/Changelog.txt index e33ca5cf..bf12f3d3 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,16 @@ Azure Storage Client Library for C++ History of Changes +Changes in v2.5: +- Upgraded Casablanca dependency to 2.9.1 +- Default Rest API version is 2015-12-11 +- Supported server-side encryption for blobs +- Fixed the bug that enumeration iterator couldn't use non-const methods, such as create/delete. +- Fixed the bug that request id used but wasn't logged correctly in unit tests. +- Changed predefinition for Windows platform from WIN32 to _WIN32. +- Fixed the bug that queue message operations throws exception "Error: The Uri for the target storage location is not specified. Please consider changing the request's location mode." on VS 2013 and Linux platform. +- Fixed the bug that xml constructor throws exception "The namespace () has not been declared." on Linux platform. + Changes in v2.4: - Added support for file service: file client, file share, file directory and file. - Performance improvements with URI cache, string concat, uri builder parameters. @@ -9,9 +19,9 @@ Changes in v2.4: - Fixed the bug that copying blob from other accounts doesn't use source credentials. - Fixed the bug that network took too long time to close while network error happened. - Fixed the bug that blob name with reserved characters didn't split with right order. -- Fixed the but that blob properties didn't clear after delettion. +- Fixed the but that blob properties didn't clear after deletion. - Fixed the coding style for static string to prevent ODR issue. -- Fixed the build issue on OS X, but not offically suporting OS X. +- Fixed the build issue on OS X, but not officially supporting OS X. Changes in v2.3: - Added the following interfaces to support programmatically configurable HTTP/HTTPS proxy diff --git a/Doxyfile b/Doxyfile index e4af641a..bb1de401 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "Microsoft Azure Storage Client Library for C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2.4.0 +PROJECT_NUMBER = 2.5.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Microsoft.WindowsAzure.Storage/CMakeLists.txt b/Microsoft.WindowsAzure.Storage/CMakeLists.txt index 7e4cfc2a..f037c7fc 100644 --- a/Microsoft.WindowsAzure.Storage/CMakeLists.txt +++ b/Microsoft.WindowsAzure.Storage/CMakeLists.txt @@ -115,7 +115,7 @@ set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARIES} ${Boo # Set version numbers centralized set (AZURESTORAGE_VERSION_MAJOR 2) -set (AZURESTORAGE_VERSION_MINOR 4) +set (AZURESTORAGE_VERSION_MINOR 5) set (AZURESTORAGE_VERSION_REVISION 0) # Add sources per configuration diff --git a/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v120.vcxproj b/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v120.vcxproj index 37036cfc..378ee1f4 100644 --- a/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v120.vcxproj +++ b/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v120.vcxproj @@ -257,12 +257,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + diff --git a/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v120.vcxproj.filters b/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v120.vcxproj.filters index ae808e5a..64f14fc5 100644 --- a/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v120.vcxproj.filters +++ b/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v120.vcxproj.filters @@ -269,6 +269,9 @@ Source Files + + Source Files + @@ -281,4 +284,4 @@ Header Files - + \ No newline at end of file diff --git a/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v140.vcxproj b/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v140.vcxproj index cca72e21..a7063946 100644 --- a/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v140.vcxproj +++ b/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.v140.vcxproj @@ -257,12 +257,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/Microsoft.WindowsAzure.Storage/includes/targetver.h b/Microsoft.WindowsAzure.Storage/includes/targetver.h index 0f73f169..a275b907 100644 --- a/Microsoft.WindowsAzure.Storage/includes/targetver.h +++ b/Microsoft.WindowsAzure.Storage/includes/targetver.h @@ -22,6 +22,6 @@ // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. -#ifdef WIN32 +#ifdef _WIN32 #include #endif diff --git a/Microsoft.WindowsAzure.Storage/includes/was/blob.h b/Microsoft.WindowsAzure.Storage/includes/was/blob.h index e6389509..a5aaded0 100644 --- a/Microsoft.WindowsAzure.Storage/includes/was/blob.h +++ b/Microsoft.WindowsAzure.Storage/includes/was/blob.h @@ -1071,7 +1071,8 @@ namespace azure { namespace storage { : m_size(0), m_type(blob_type::unspecified), m_lease_status(azure::storage::lease_status::unspecified), m_lease_state(azure::storage::lease_state::unspecified), m_lease_duration(azure::storage::lease_duration::unspecified), - m_page_blob_sequence_number(0), m_append_blob_committed_block_count(0) + m_page_blob_sequence_number(0), m_append_blob_committed_block_count(0), + m_server_encrypted(false) { } @@ -1112,6 +1113,7 @@ namespace azure { namespace storage { m_lease_duration = std::move(other.m_lease_duration); m_page_blob_sequence_number = std::move(other.m_page_blob_sequence_number); m_append_blob_committed_block_count = std::move(other.m_append_blob_committed_block_count); + m_server_encrypted = std::move(other.m_server_encrypted); } return *this; } @@ -1306,6 +1308,15 @@ namespace azure { namespace storage { return m_append_blob_committed_block_count; } + /// + /// Gets server encryption states. + /// + /// true if the blob is encrypted on server side; otherwise, false. + bool server_encrypted() const + { + return m_server_encrypted; + } + private: /// @@ -1338,6 +1349,7 @@ namespace azure { namespace storage { azure::storage::lease_duration m_lease_duration; int64_t m_page_blob_sequence_number; int m_append_blob_committed_block_count; + bool m_server_encrypted; void copy_from_root(const cloud_blob_properties& root_blob_properties); void update_etag_and_last_modified(const cloud_blob_properties& parsed_properties); @@ -1345,6 +1357,11 @@ namespace azure { namespace storage { void update_page_blob_sequence_number(const cloud_blob_properties& parsed_properties); void update_append_blob_committed_block_count(const cloud_blob_properties& parsed_properties); void update_all(const cloud_blob_properties& parsed_properties, bool ignore_md5); + + void set_server_encrypted(bool server_encrypted) + { + m_server_encrypted = server_encrypted; + } friend class cloud_blob; friend class cloud_block_blob; @@ -1962,6 +1979,34 @@ namespace azure { namespace storage { int64_t m_end_offset; }; + class page_diff_range : public page_range + { + public: + /// + /// Initializes a new instance of the class. + /// + /// The starting offset. + /// The ending offset. + /// true if the range was cleared range; otherwise false. It was set as non-cleared range at default. + page_diff_range(int64_t start_offset, int64_t end_offset, bool is_cleared = false) + : page_range(start_offset, end_offset), + m_cleared_range(is_cleared) + { + } + + /// + /// Checks the range type as cleared range or not. + /// + /// true if the range was cleared range; otherwise false. + bool is_cleared_rage() const + { + return m_cleared_range; + } + + private: + bool m_cleared_range; + }; + /// /// Describes actions that can be performed on a page blob sequence number. /// @@ -5842,6 +5887,104 @@ namespace azure { namespace storage { /// A object of type , of type , that represents the current operation. WASTORAGE_API pplx::task> download_page_ranges_async(utility::size64_t offset, utility::size64_t length, const access_condition& condition, const blob_request_options& options, operation_context context) const; + /// + /// Gets a collection of valid page ranges and their starting and ending bytes, only pages that were changed between target blob and previous snapshot. + /// + /// An snapshot time that represents previous snapshot. + /// An enumerable collection of page diff ranges. + std::vector download_page_ranges_diff(utility::string_t previous_snapshot_time) const + { + return download_page_ranges_diff_async(previous_snapshot_time).get(); + } + + /// + /// Gets a collection of valid page ranges and their starting and ending bytes, only pages that were changed between target blob and previous snapshot. + /// + /// An snapshot time that represents previous snapshot. + /// An object that represents the access condition for the operation. + /// An object that specifies additional options for the request. + /// An object that represents the context for the current operation. + /// An enumerable collection of page diff ranges. + std::vector download_page_ranges_diff(utility::string_t previous_snapshot_time, const access_condition& condition, const blob_request_options& options, operation_context context) const + { + return download_page_ranges_diff_async(previous_snapshot_time, condition, options, context).get(); + } + + /// + /// Gets a collection of valid page ranges and their starting and ending bytes, only pages that were changed between target blob and previous snapshot. + /// + /// An snapshot time that represents previous snapshot. + /// The starting offset of the data range over which to list page ranges, in bytes. Must be a multiple of 512. + /// The length of the data range over which to list page ranges, in bytes. Must be a multiple of 512. + /// An enumerable collection of page diff ranges. + std::vector download_page_ranges_diff(utility::string_t previous_snapshot_time, utility::size64_t offset, utility::size64_t length) const + { + return download_page_ranges_diff_async(previous_snapshot_time, offset, length).get(); + } + + /// + /// Gets a collection of valid page ranges and their starting and ending bytes, only pages that were changed between target blob and previous snapshot. + /// + /// An snapshot time that represents previous snapshot. + /// The starting offset of the data range over which to list page ranges, in bytes. Must be a multiple of 512. + /// The length of the data range over which to list page ranges, in bytes. Must be a multiple of 512. + /// An object that represents the access condition for the operation. + /// An object that specifies additional options for the request. + /// An object that represents the context for the current operation. + /// An enumerable collection of page diff ranges. + std::vector download_page_ranges_diff(utility::string_t previous_snapshot_time, utility::size64_t offset, utility::size64_t length, const access_condition& condition, const blob_request_options& options, operation_context context) const + { + return download_page_ranges_diff_async(previous_snapshot_time, offset, length, condition, options, context).get(); + } + + /// + /// Intitiates an asynchronous operation to get a collection of valid page ranges and their starting and ending bytes, only pages that were changed between target blob and previous snapshot. + /// + /// An snapshot time that represents previous snapshot. + /// A object of type , of type , that represents the current operation. + pplx::task> download_page_ranges_diff_async(utility::string_t previous_snapshot_time) const + { + return download_page_ranges_diff_async(previous_snapshot_time, access_condition(), blob_request_options(), operation_context()); + } + + /// + /// Intitiates an asynchronous operation to get a collection of valid page ranges and their starting and ending bytes, only pages that were changed between target blob and previous snapshot. + /// + /// An snapshot time that represents previous snapshot. + /// An object that represents the access condition for the operation. + /// An object that specifies additional options for the request. + /// An object that represents the context for the current operation. + /// A object of type , of type , that represents the current operation. + pplx::task> download_page_ranges_diff_async(utility::string_t previous_snapshot_time, const access_condition& condition, const blob_request_options& options, operation_context context) const + { + return download_page_ranges_diff_async(previous_snapshot_time, std::numeric_limits::max(), 0, condition, options, context); + } + + /// + /// Intitiates an asynchronous operation to get a collection of valid page ranges and their starting and ending bytes, only pages that were changed between target blob and previous snapshot. + /// + /// An snapshot time that represents previous snapshot. + /// The starting offset of the data range over which to list page ranges, in bytes. Must be a multiple of 512. + /// The length of the data range over which to list page ranges, in bytes. Must be a multiple of 512. + /// A object of type , of type , that represents the current operation. + pplx::task> download_page_ranges_diff_async(utility::string_t previous_snapshot_time, utility::size64_t offset, utility::size64_t length) const + { + return download_page_ranges_diff_async(previous_snapshot_time, offset, length, access_condition(), blob_request_options(), operation_context()); + } + + /// + /// Intitiates an asynchronous operation to get a collection of valid page ranges and their starting and ending bytes, only pages that were changed between target blob and previous snapshot. + /// + /// An snapshot time that represents previous snapshot. + /// The starting offset of the data range over which to list page ranges, in bytes. Must be a multiple of 512. + /// The length of the data range over which to list page ranges, in bytes. Must be a multiple of 512. + /// An object that represents the access condition for the operation. + /// An object that specifies additional options for the request. + /// An object that represents the context for the current operation. + /// A object of type , of type , that represents the current operation. + WASTORAGE_API pplx::task> download_page_ranges_diff_async(utility::string_t previous_snapshot_time, utility::size64_t offset, utility::size64_t length, const access_condition& condition, const blob_request_options& options, operation_context context) const; + + /// /// Writes pages to a page blob. /// diff --git a/Microsoft.WindowsAzure.Storage/includes/was/common.h b/Microsoft.WindowsAzure.Storage/includes/was/common.h index 2a195d9a..7e9e8874 100644 --- a/Microsoft.WindowsAzure.Storage/includes/was/common.h +++ b/Microsoft.WindowsAzure.Storage/includes/was/common.h @@ -23,7 +23,7 @@ #include "core.h" #include "retry_policies.h" -#ifndef WIN32 +#ifndef _WIN32 #include #include #include @@ -39,6 +39,8 @@ namespace azure { namespace storage { class list_blobs_reader; } + template class result_iterator; + /// /// Represents the user meta-data for queues, containers and blobs. /// @@ -225,8 +227,17 @@ namespace azure { namespace storage { private: + result_type& results(size_t index) + { + if(index < m_results.size()) + return m_results[index]; + throw std::runtime_error("index is out of the results range"); + } + std::vector m_results; azure::storage::continuation_token m_continuation_token; + + friend class result_iterator; }; /// @@ -313,11 +324,26 @@ namespace azure { namespace storage { return m_result_segment.results()[m_segment_index]; } + result_type& operator*() + { + if (passed_the_end()) + { + throw std::runtime_error("cannot dereference past-the-end iterator"); + } + + return m_result_segment.results(m_segment_index); + } + const result_type* operator->() const { return (std::pointer_traits::pointer_to(**this)); } + result_type* operator->() + { + return (std::pointer_traits::pointer_to(**this)); + } + result_iterator& operator++() { // preincrement @@ -1653,7 +1679,7 @@ namespace azure { namespace storage { m_response_received = value; } -#ifndef WIN32 +#ifndef _WIN32 /// /// Gets the logger object on this operation context. /// @@ -1694,7 +1720,7 @@ namespace azure { namespace storage { web::web_proxy m_proxy; std::vector m_request_results; pplx::extensibility::critical_section_t m_request_results_lock; -#ifndef WIN32 +#ifndef _WIN32 boost::log::sources::severity_logger m_logger; #endif }; @@ -1898,7 +1924,7 @@ namespace azure { namespace storage { m_impl->set_proxy(std::move(proxy)); } -#ifndef WIN32 +#ifndef _WIN32 /// /// Gets the logger object on this operation context. /// @@ -2104,7 +2130,7 @@ namespace azure { namespace storage { utility::string_t m_minimum_address; utility::string_t m_maximum_address; bool m_single_address; -#ifdef WIN32 +#ifdef _WIN32 struct ip_address { bool ipv4; diff --git a/Microsoft.WindowsAzure.Storage/includes/was/core.h b/Microsoft.WindowsAzure.Storage/includes/was/core.h index a95838d8..8003d9c9 100644 --- a/Microsoft.WindowsAzure.Storage/includes/was/core.h +++ b/Microsoft.WindowsAzure.Storage/includes/was/core.h @@ -640,6 +640,7 @@ namespace azure { namespace storage { m_content_length = std::move(other.m_content_length); m_content_md5 = std::move(other.m_content_md5); m_etag = std::move(other.m_etag); + m_request_server_encrypted = other.m_request_server_encrypted; m_extended_error = std::move(other.m_extended_error); } return *this; @@ -778,6 +779,7 @@ namespace azure { namespace storage { utility::size64_t m_content_length; utility::string_t m_content_md5; utility::string_t m_etag; + bool m_request_server_encrypted; storage_extended_error m_extended_error; }; @@ -1166,6 +1168,6 @@ namespace azure { namespace storage { }} // namespace azure::storage -#ifndef WIN32 +#ifndef _WIN32 #define UNREFERENCED_PARAMETER(P) (P) #endif diff --git a/Microsoft.WindowsAzure.Storage/includes/was/queue.h b/Microsoft.WindowsAzure.Storage/includes/was/queue.h index 10f5b6e8..6f9386b6 100644 --- a/Microsoft.WindowsAzure.Storage/includes/was/queue.h +++ b/Microsoft.WindowsAzure.Storage/includes/was/queue.h @@ -786,6 +786,7 @@ namespace azure { namespace storage { m_client = std::move(other.m_client); m_name = std::move(other.m_name); m_uri = std::move(other.m_uri); + m_queue_message_uri = std::move(other.m_queue_message_uri); m_approximate_message_count = std::move(other.m_approximate_message_count); m_metadata = std::move(other.m_metadata); } diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/basic_types.h b/Microsoft.WindowsAzure.Storage/includes/wascore/basic_types.h index 282f8f41..58690ee4 100644 --- a/Microsoft.WindowsAzure.Storage/includes/wascore/basic_types.h +++ b/Microsoft.WindowsAzure.Storage/includes/wascore/basic_types.h @@ -30,13 +30,13 @@ #endif #endif -#ifdef WIN32 +#ifdef _WIN32 #define DEPRECATED(message) __declspec(deprecated(message)) #else #define DEPRECATED(message) __attribute__((deprecated(message))) #endif -#ifdef WIN32 +#ifdef _WIN32 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN @@ -57,7 +57,7 @@ namespace utility { //typedef struct { uint8_t data[16]; } uuid; -#ifdef WIN32 +#ifdef _WIN32 typedef UUID uuid; #else typedef struct diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/constants.dat b/Microsoft.WindowsAzure.Storage/includes/wascore/constants.dat index 3a4d239b..8776f012 100644 --- a/Microsoft.WindowsAzure.Storage/includes/wascore/constants.dat +++ b/Microsoft.WindowsAzure.Storage/includes/wascore/constants.dat @@ -31,6 +31,7 @@ DAT(service_file, _XPLATSTR("file")) DAT(uri_query_timeout, _XPLATSTR("timeout")) DAT(uri_query_resource_type, _XPLATSTR("restype")) DAT(uri_query_snapshot, _XPLATSTR("snapshot")) +DAT(uri_query_prevsnapshot, _XPLATSTR("prevsnapshot")) DAT(uri_query_component, _XPLATSTR("comp")) DAT(uri_query_block_id, _XPLATSTR("blockid")) DAT(uri_query_block_list_type, _XPLATSTR("blocklisttype")) @@ -131,6 +132,7 @@ DAT(ms_header_blob_condition_maxsize, _XPLATSTR("x-ms-blob-condition-maxsize")) DAT(ms_header_blob_condition_appendpos, _XPLATSTR("x-ms-blob-condition-appendpos")) DAT(ms_header_blob_append_offset, _XPLATSTR("x-ms-blob-append-offset")) DAT(ms_header_blob_committed_block_count, _XPLATSTR("x-ms-blob-committed-block-count")) +DAT(ms_header_server_encrypted, _XPLATSTR("x-ms-server-encrypted")) DAT(ms_header_copy_id, _XPLATSTR("x-ms-copy-id")) DAT(ms_header_copy_completion_time, _XPLATSTR("x-ms-copy-completion-time")) DAT(ms_header_copy_action, _XPLATSTR("x-ms-copy-action")) @@ -140,6 +142,7 @@ DAT(ms_header_copy_status_description, _XPLATSTR("x-ms-copy-status-description") DAT(ms_header_copy_source, _XPLATSTR("x-ms-copy-source")) DAT(ms_header_delete_snapshots, _XPLATSTR("x-ms-delete-snapshots")) DAT(ms_header_request_id, _XPLATSTR("x-ms-request-id")) +DAT(ms_header_request_server_encrypted, _XPLATSTR("x-ms-request-server-encrypted")) DAT(ms_header_client_request_id, _XPLATSTR("x-ms-client-request-id")) DAT(ms_header_range, _XPLATSTR("x-ms-range")) DAT(ms_header_page_write, _XPLATSTR("x-ms-page-write")) @@ -170,7 +173,7 @@ DAT(ms_header_time_next_visible, _XPLATSTR("x-ms-time-next-visible")) DAT(ms_header_share_quota, _XPLATSTR("x-ms-share-quota")) // header values -DAT(header_value_storage_version, _XPLATSTR("2015-04-05")) +DAT(header_value_storage_version, _XPLATSTR("2015-12-11")) DAT(header_value_true, _XPLATSTR("true")) DAT(header_value_false, _XPLATSTR("false")) DAT(header_value_locked, _XPLATSTR("locked")) @@ -248,6 +251,7 @@ DAT(xml_enumeration_results, _XPLATSTR("EnumerationResults")) DAT(xml_service_endpoint, _XPLATSTR("ServiceEndpoint")) DAT(xml_container_name, _XPLATSTR("ContainerName")) DAT(xml_page_range, _XPLATSTR("PageRange")) +DAT(xml_clear_range, _XPLATSTR("ClearRange")) DAT(xml_start, _XPLATSTR("Start")) DAT(xml_end, _XPLATSTR("End")) DAT(xml_committed_blocks, _XPLATSTR("CommittedBlocks")) @@ -306,7 +310,7 @@ DAT(xml_shares, _XPLATSTR("Shares")) #define STR(x) #x #define VER(x) _XPLATSTR("Azure-Storage/2.4.0 (Native; Windows; MSC_VER " STR(x) ")") -#if defined(WIN32) +#if defined(_WIN32) #if defined(_MSC_VER) #if _MSC_VER == 1800 DAT(header_value_user_agent, _XPLATSTR("Azure-Storage/2.4.0 (Native; Windows; MSC_VER 1800 )")) diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h b/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h index fcd9674c..dd8afa28 100644 --- a/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h +++ b/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h @@ -450,8 +450,13 @@ namespace azure { namespace storage { namespace core { } // 5-6. Potentially upload data and get response +#ifdef _WIN32 web::http::client::http_client client(instance->m_request.request_uri().authority(), config); - return client.request(instance->m_request).then([instance](pplx::task get_headers_task) -> pplx::task + return client.request(instance->m_request).then([instance](pplx::task get_headers_task)->pplx::task +#else + std::shared_ptr client = core::http_client_reusable::get_http_client(instance->m_request.request_uri().authority(), config); + return client->request(instance->m_request).then([instance](pplx::task get_headers_task) -> pplx::task +#endif // _WIN32 { // Headers are ready. It should be noted that http_client will // continue to download the response body in parallel. diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/hashing.h b/Microsoft.WindowsAzure.Storage/includes/wascore/hashing.h index 5463942c..af53e284 100644 --- a/Microsoft.WindowsAzure.Storage/includes/wascore/hashing.h +++ b/Microsoft.WindowsAzure.Storage/includes/wascore/hashing.h @@ -22,7 +22,7 @@ #include "wascore/basic_types.h" #include "was/core.h" -#ifdef WIN32 +#ifdef _WIN32 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #endif @@ -51,7 +51,7 @@ namespace azure { namespace storage { namespace core { virtual utility::string_t hash() const = 0; }; -#ifdef WIN32 +#ifdef _WIN32 class cryptography_hash_algorithm { diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/logging.h b/Microsoft.WindowsAzure.Storage/includes/wascore/logging.h index f0a82224..7cb14d4e 100644 --- a/Microsoft.WindowsAzure.Storage/includes/wascore/logging.h +++ b/Microsoft.WindowsAzure.Storage/includes/wascore/logging.h @@ -35,7 +35,7 @@ namespace azure { namespace storage { namespace core { void log(azure::storage::operation_context context, client_log_level level, const std::string& message) const; -#ifdef WIN32 +#ifdef _WIN32 void log(azure::storage::operation_context context, client_log_level level, const std::wstring& message) const; #endif bool should_log(azure::storage::operation_context context, client_log_level level) const; diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/protocol.h b/Microsoft.WindowsAzure.Storage/includes/wascore/protocol.h index e49dcaaf..21a1f997 100644 --- a/Microsoft.WindowsAzure.Storage/includes/wascore/protocol.h +++ b/Microsoft.WindowsAzure.Storage/includes/wascore/protocol.h @@ -51,6 +51,7 @@ namespace azure { namespace storage { namespace protocol { web::http::http_request put_block_list(const cloud_blob_properties& properties, const cloud_metadata& metadata, const utility::string_t& content_md5, const access_condition& condition, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context); web::http::http_request get_block_list(block_listing_filter listing_filter, const utility::string_t& snapshot_time, const access_condition& condition, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context); web::http::http_request get_page_ranges(utility::size64_t offset, utility::size64_t length, const utility::string_t& snapshot_time, const access_condition& condition, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context); + web::http::http_request get_page_ranges_diff(utility::string_t previous_snapshort_time, utility::size64_t offset, utility::size64_t length, const utility::string_t& snapshot_time, const access_condition& condition, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context); web::http::http_request put_page(page_range range, page_write write, const utility::string_t& content_md5, const access_condition& condition, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context); web::http::http_request append_block(const utility::string_t& content_md5, const access_condition& condition, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context); web::http::http_request put_block_blob(const cloud_blob_properties& properties, const cloud_metadata& metadata, const access_condition& condition, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context); diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/protocol_xml.h b/Microsoft.WindowsAzure.Storage/includes/wascore/protocol_xml.h index 73837f20..6657f9f2 100644 --- a/Microsoft.WindowsAzure.Storage/includes/wascore/protocol_xml.h +++ b/Microsoft.WindowsAzure.Storage/includes/wascore/protocol_xml.h @@ -281,6 +281,32 @@ namespace azure { namespace storage { namespace protocol { int64_t m_end; }; + class page_diff_list_reader : public core::xml::xml_reader + { + public: + + explicit page_diff_list_reader(concurrency::streams::istream stream) + : xml_reader(stream), m_start(-1), m_end(-1) + { + } + + // Extracts the result. This method can only be called once on this reader + std::vector move_result() + { + parse(); + return std::move(m_page_list); + } + + protected: + + virtual void handle_element(const utility::string_t& element_name); + virtual void handle_end_element(const utility::string_t& element_name); + + std::vector m_page_list; + int64_t m_start; + int64_t m_end; + }; + class block_list_reader : public core::xml::xml_reader { public: diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/util.h b/Microsoft.WindowsAzure.Storage/includes/wascore/util.h index 48d388f6..0361ebe6 100644 --- a/Microsoft.WindowsAzure.Storage/includes/wascore/util.h +++ b/Microsoft.WindowsAzure.Storage/includes/wascore/util.h @@ -17,6 +17,11 @@ #pragma once +#include + +#ifndef _WIN32 + #include "pplx/threadpool.h" +#endif #include "cpprest/streams.h" #include "was/core.h" @@ -105,4 +110,18 @@ namespace azure { namespace storage { namespace core { #pragma endregion +#ifndef _WIN32 + class http_client_reusable + { + public: + WASTORAGE_API static std::shared_ptr get_http_client(const web::uri& uri); + WASTORAGE_API static std::shared_ptr get_http_client(const web::uri& uri, const web::http::client::http_client_config& config); + + private: + static const boost::asio::io_service& s_service; + WASTORAGE_API static std::map> s_http_clients; + WASTORAGE_API static std::mutex s_mutex; + }; +#endif + }}} // namespace azure::storage::core diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/xmlhelpers.h b/Microsoft.WindowsAzure.Storage/includes/wascore/xmlhelpers.h index 845975d9..0f2f64e4 100644 --- a/Microsoft.WindowsAzure.Storage/includes/wascore/xmlhelpers.h +++ b/Microsoft.WindowsAzure.Storage/includes/wascore/xmlhelpers.h @@ -43,7 +43,7 @@ #pragma once #ifndef _XMLHELPERS_H #define _XMLHELPERS_H -#ifdef WIN32 +#ifdef _WIN32 #include #include #else @@ -165,7 +165,7 @@ class xml_reader /// void pause() { m_continueParsing = false; } -#ifdef WIN32 +#ifdef _WIN32 CComPtr m_reader; #else std::shared_ptr m_reader; @@ -267,7 +267,7 @@ class xml_writer UNREFERENCED_PARAMETER(error); } private: -#ifdef WIN32 +#ifdef _WIN32 CComPtr m_writer; #else // LINUX std::shared_ptr m_document; diff --git a/Microsoft.WindowsAzure.Storage/packages.config b/Microsoft.WindowsAzure.Storage/packages.config index ebd30628..f08160b6 100644 --- a/Microsoft.WindowsAzure.Storage/packages.config +++ b/Microsoft.WindowsAzure.Storage/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/Microsoft.WindowsAzure.Storage/src/basic_types.cpp b/Microsoft.WindowsAzure.Storage/src/basic_types.cpp index 0b67d480..d723ff3e 100644 --- a/Microsoft.WindowsAzure.Storage/src/basic_types.cpp +++ b/Microsoft.WindowsAzure.Storage/src/basic_types.cpp @@ -25,7 +25,7 @@ namespace utility { { uuid result; -#ifdef WIN32 +#ifdef _WIN32 RPC_STATUS status; status = UuidCreate(&result); @@ -42,7 +42,7 @@ namespace utility { utility::string_t __cdecl uuid_to_string(const utility::uuid& value) { -#ifdef WIN32 +#ifdef _WIN32 RPC_STATUS status; RPC_WSTR rpc_string; @@ -73,7 +73,7 @@ namespace utility { { uuid result; -#ifdef WIN32 +#ifdef _WIN32 RPC_STATUS status; RPC_WSTR rpc_string = reinterpret_cast(const_cast(value.c_str())); @@ -96,7 +96,7 @@ namespace utility { bool __cdecl uuid_equal(const utility::uuid& value1, const utility::uuid& value2) { -#ifdef WIN32 +#ifdef _WIN32 return value1 == value2; #else return uuid_compare(value1.data, value2.data) == 0; diff --git a/Microsoft.WindowsAzure.Storage/src/blob_request_factory.cpp b/Microsoft.WindowsAzure.Storage/src/blob_request_factory.cpp index e64b7183..c31827ea 100644 --- a/Microsoft.WindowsAzure.Storage/src/blob_request_factory.cpp +++ b/Microsoft.WindowsAzure.Storage/src/blob_request_factory.cpp @@ -44,6 +44,14 @@ namespace azure { namespace storage { namespace protocol { } } + void add_previous_snapshot_time(web::http::uri_builder& uri_builder, const utility::string_t& snapshot_time) + { + if (!snapshot_time.empty()) + { + uri_builder.append_query(core::make_query_parameter(uri_query_prevsnapshot, snapshot_time)); + } + } + web::http::http_request create_blob_container(blob_container_public_access_type access_type, const cloud_metadata& metadata, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context) { uri_builder.append_query(core::make_query_parameter(uri_query_resource_type, resource_container, /* do_encoding */ false)); @@ -308,6 +316,17 @@ namespace azure { namespace storage { namespace protocol { return request; } + web::http::http_request get_page_ranges_diff(utility::string_t previous_snapshot_time, utility::size64_t offset, utility::size64_t length, const utility::string_t& snapshot_time, const access_condition& condition, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context) + { + add_snapshot_time(uri_builder, snapshot_time); + add_previous_snapshot_time(uri_builder, previous_snapshot_time); + uri_builder.append_query(core::make_query_parameter(uri_query_component, component_page_list, /* do_encoding */ false)); + web::http::http_request request(base_request(web::http::methods::GET, uri_builder, timeout, context)); + add_range(request, offset, length); + add_access_condition(request, condition); + return request; + } + web::http::http_request put_page(page_range range, page_write write, const utility::string_t& content_md5, const access_condition& condition, web::http::uri_builder& uri_builder, const std::chrono::seconds& timeout, operation_context context) { uri_builder.append_query(core::make_query_parameter(uri_query_component, component_page, /* do_encoding */ false)); diff --git a/Microsoft.WindowsAzure.Storage/src/blob_response_parsers.cpp b/Microsoft.WindowsAzure.Storage/src/blob_response_parsers.cpp index dc7d8d58..2c36b2b5 100644 --- a/Microsoft.WindowsAzure.Storage/src/blob_response_parsers.cpp +++ b/Microsoft.WindowsAzure.Storage/src/blob_response_parsers.cpp @@ -110,6 +110,8 @@ namespace azure { namespace storage { namespace protocol { properties.m_content_type = get_header_value(headers, web::http::header_names::content_type); properties.m_type = parse_blob_type(get_header_value(headers, ms_header_blob_type)); + properties.m_server_encrypted = (get_header_value(headers, ms_header_server_encrypted) == _XPLATSTR("true")); + return properties; } diff --git a/Microsoft.WindowsAzure.Storage/src/cloud_common.cpp b/Microsoft.WindowsAzure.Storage/src/cloud_common.cpp index d0b972a5..2754d25c 100644 --- a/Microsoft.WindowsAzure.Storage/src/cloud_common.cpp +++ b/Microsoft.WindowsAzure.Storage/src/cloud_common.cpp @@ -20,7 +20,7 @@ #include "was/common.h" #include "wascore/resources.h" -#ifdef WIN32 +#ifdef _WIN32 #include "Ws2tcpip.h" #else #include "boost/asio/ip/address.hpp" @@ -38,7 +38,7 @@ namespace azure { namespace storage { shared_access_policy::ip_address_or_range::ip_address shared_access_policy::ip_address_or_range::try_parse(const utility::string_t &address) { shared_access_policy::ip_address_or_range::ip_address ip; -#ifdef WIN32 +#ifdef _WIN32 IN_ADDR addr; int ret = InetPton(AF_INET, address.data(), &addr); if (ret == 1) @@ -90,7 +90,7 @@ namespace azure { namespace storage { { auto min_addr = try_parse(m_minimum_address); auto max_addr = try_parse(m_maximum_address); -#ifdef WIN32 +#ifdef _WIN32 if (min_addr.addr > max_addr.addr) #else if (min_addr > max_addr) diff --git a/Microsoft.WindowsAzure.Storage/src/cloud_page_blob.cpp b/Microsoft.WindowsAzure.Storage/src/cloud_page_blob.cpp index 05e1afbc..34c4c118 100644 --- a/Microsoft.WindowsAzure.Storage/src/cloud_page_blob.cpp +++ b/Microsoft.WindowsAzure.Storage/src/cloud_page_blob.cpp @@ -240,5 +240,33 @@ namespace azure { namespace storage { }); return core::executor>::execute_async(command, modified_options, context); } + + pplx::task> cloud_page_blob::download_page_ranges_diff_async(utility::string_t previous_snapshot_time, utility::size64_t offset, utility::size64_t length, const access_condition& condition, const blob_request_options& options, operation_context context) const + { + blob_request_options modified_options(options); + modified_options.apply_defaults(service_client().default_request_options(), type()); + + auto properties = m_properties; + + auto command = std::make_shared>>(uri()); + command->set_build_request(std::bind(protocol::get_page_ranges_diff, previous_snapshot_time, offset, length, snapshot_time(), condition, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + command->set_authentication_handler(service_client().authentication_handler()); + command->set_location_mode(core::command_location_mode::primary_or_secondary); + command->set_preprocess_response([properties](const web::http::http_response& response, const request_result& result, operation_context context) -> std::vector + { + protocol::preprocess_response_void(response, result, context); + auto parsed_properties = protocol::blob_response_parsers::parse_blob_properties(response); + properties->update_etag_and_last_modified(parsed_properties); + properties->update_size(parsed_properties); + return std::vector(); + }); + command->set_postprocess_response([](const web::http::http_response& response, const request_result&, const core::ostream_descriptor&, operation_context context) -> pplx::task> + { + UNREFERENCED_PARAMETER(context); + protocol::page_diff_list_reader reader(response.body()); + return pplx::task_from_result(reader.move_result()); + }); + return core::executor>::execute_async(command, modified_options, context); + } }} // namespace azure::storage diff --git a/Microsoft.WindowsAzure.Storage/src/hashing.cpp b/Microsoft.WindowsAzure.Storage/src/hashing.cpp index ce9c1d50..cd187252 100644 --- a/Microsoft.WindowsAzure.Storage/src/hashing.cpp +++ b/Microsoft.WindowsAzure.Storage/src/hashing.cpp @@ -20,7 +20,7 @@ namespace azure { namespace storage { namespace core { -#ifdef WIN32 +#ifdef _WIN32 cryptography_hash_algorithm::cryptography_hash_algorithm(LPCWSTR algorithm_id, ULONG flags) { diff --git a/Microsoft.WindowsAzure.Storage/src/logging.cpp b/Microsoft.WindowsAzure.Storage/src/logging.cpp index 7541a009..08118eb1 100644 --- a/Microsoft.WindowsAzure.Storage/src/logging.cpp +++ b/Microsoft.WindowsAzure.Storage/src/logging.cpp @@ -18,7 +18,7 @@ #include "stdafx.h" #include "wascore/logging.h" -#ifdef WIN32 +#ifdef _WIN32 #include #include #else @@ -36,7 +36,7 @@ namespace azure { namespace storage { namespace core { -#ifdef WIN32 +#ifdef _WIN32 const std::wstring wconnector(L" : "); // {EE5D17C5-1B3E-4792-B0F9-F8C5FC6AC22A} @@ -156,7 +156,7 @@ namespace azure { namespace storage { namespace core { return (level != client_log_level::log_level_off) && (level <= context.log_level()); } -#endif // WIN32 +#endif // _WIN32 logger logger::m_instance; diff --git a/Microsoft.WindowsAzure.Storage/src/protocol_xml.cpp b/Microsoft.WindowsAzure.Storage/src/protocol_xml.cpp index 2f69cbba..105a393f 100644 --- a/Microsoft.WindowsAzure.Storage/src/protocol_xml.cpp +++ b/Microsoft.WindowsAzure.Storage/src/protocol_xml.cpp @@ -360,6 +360,44 @@ namespace azure { namespace storage { namespace protocol { } } + void page_diff_list_reader::handle_element(const utility::string_t& element_name) + { + if (element_name == xml_start && m_start == -1) + { + extract_current_element(m_start); + } + else if (element_name == xml_end && m_end == -1) + { + extract_current_element(m_end); + } + } + + void page_diff_list_reader::handle_end_element(const utility::string_t& element_name) + { + if (element_name == xml_page_range) + { + if (m_start != -1 && m_end != -1) + { + page_diff_range range(m_start, m_end); + m_page_list.push_back(range); + } + + m_start = -1; + m_end = -1; + } + else if (element_name == xml_clear_range) + { + if (m_start != -1 && m_end != -1) + { + page_diff_range range(m_start, m_end, true); + m_page_list.push_back(range); + } + + m_start = -1; + m_end = -1; + } + } + void block_list_reader::handle_begin_element(const utility::string_t& element_name) { if (element_name == xml_committed_blocks) diff --git a/Microsoft.WindowsAzure.Storage/src/request_result.cpp b/Microsoft.WindowsAzure.Storage/src/request_result.cpp index 9584268a..bd7721ce 100644 --- a/Microsoft.WindowsAzure.Storage/src/request_result.cpp +++ b/Microsoft.WindowsAzure.Storage/src/request_result.cpp @@ -57,6 +57,12 @@ namespace azure { namespace storage { headers.match(web::http::header_names::content_md5, m_content_md5); headers.match(web::http::header_names::etag, m_etag); + utility::string_t request_server_encrypted; + if (headers.match(protocol::ms_header_request_server_encrypted, request_server_encrypted)) + { + m_request_server_encrypted = (request_server_encrypted == _XPLATSTR("true")); + } + utility::string_t request_date; if (headers.match(web::http::header_names::date, request_date)) { diff --git a/Microsoft.WindowsAzure.Storage/src/util.cpp b/Microsoft.WindowsAzure.Storage/src/util.cpp index db5384bb..e03dec2d 100644 --- a/Microsoft.WindowsAzure.Storage/src/util.cpp +++ b/Microsoft.WindowsAzure.Storage/src/util.cpp @@ -21,11 +21,11 @@ #include "wascore/constants.h" #include "wascore/resources.h" -#ifndef WIN32 +#ifndef _WIN32 #include "pplx/threadpool.h" #endif -#ifdef WIN32 +#ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #include @@ -194,7 +194,7 @@ namespace azure { namespace storage { namespace core { bool is_nan(double value) { -#ifdef WIN32 +#ifdef _WIN32 return _isnan(value) != 0; #else return std::isnan(value); @@ -203,7 +203,7 @@ namespace azure { namespace storage { namespace core { bool is_finite(double value) { -#ifdef WIN32 +#ifdef _WIN32 return _finite(value) != 0; #else return std::isfinite(value); @@ -279,7 +279,7 @@ namespace azure { namespace storage { namespace core { { // TODO: Remove this function if Casablanca changes their datetime serialization to not trim trailing zeros in the fractional seconds component of a time -#ifdef WIN32 +#ifdef _WIN32 int status; ULARGE_INTEGER largeInt; @@ -368,14 +368,14 @@ namespace azure { namespace storage { namespace core { #endif } -#ifdef WIN32 +#ifdef _WIN32 class delay_event #else class delay_event : public std::enable_shared_from_this #endif { public: -#ifdef WIN32 +#ifdef _WIN32 delay_event(std::chrono::milliseconds timeout) : m_callback(new concurrency::call(std::function(std::bind(&delay_event::timer_fired, this, std::placeholders::_1)))), m_timer(static_cast(timeout.count()), 0, m_callback, false) { @@ -408,14 +408,14 @@ namespace azure { namespace storage { namespace core { private: pplx::task_completion_event m_completion_event; -#ifdef WIN32 +#ifdef _WIN32 concurrency::call* m_callback; concurrency::timer m_timer; #else boost::asio::deadline_timer m_timer; #endif -#ifdef WIN32 +#ifdef _WIN32 void timer_fired(const int& dummy) #else void timer_fired(const boost::system::error_code& dummy) @@ -429,14 +429,14 @@ namespace azure { namespace storage { namespace core { pplx::task complete_after(std::chrono::milliseconds timeout) { -#ifdef WIN32 +#ifdef _WIN32 delay_event* event = new delay_event(timeout); #else auto event = std::make_shared(timeout); #endif event->start(); -#ifdef WIN32 +#ifdef _WIN32 return event->create_task().then([event]() { delete event; @@ -447,4 +447,61 @@ namespace azure { namespace storage { namespace core { } +#ifndef _WIN32 + const boost::asio::io_service& http_client_reusable::s_service = crossplat::threadpool::shared_instance().service(); + std::map> http_client_reusable::s_http_clients; + std::mutex http_client_reusable::s_mutex; + + std::shared_ptr http_client_reusable::get_http_client(const web::uri& uri) + { + utility::string_t key(uri.to_string()); + + std::lock_guard guard(s_mutex); + auto iter = s_http_clients.find(key); + if (iter == s_http_clients.end()) + { + auto http_client = std::make_shared(uri); + s_http_clients[key] = http_client; + return http_client; + } + else + { + return iter->second; + } + } + + std::shared_ptr http_client_reusable::get_http_client(const web::uri& uri, const web::http::client::http_client_config& config) + { + utility::string_t key(uri.to_string()); + key.append(_XPLATSTR("#")); + if (config.proxy().is_specified()) + { + key.append(_XPLATSTR("0#")); + key.append(config.proxy().address().to_string()); + key.append(_XPLATSTR("#")); + } + else + { + key.append(_XPLATSTR("1#")); + } + key.append(utility::conversions::print_string(config.timeout().count())); + key.append(_XPLATSTR("#")); + key.append(utility::conversions::print_string(config.chunksize())); + key.append(_XPLATSTR("#")); + + std::lock_guard guard(s_mutex); + auto iter = s_http_clients.find(key); + if (iter == s_http_clients.end()) + { + auto http_client = std::make_shared(uri, config); + s_http_clients[key] = http_client; + return http_client; + } + else + { + return iter->second; + } + } +#endif + }}} // namespace azure::storage::core diff --git a/Microsoft.WindowsAzure.Storage/src/xmlhelpers.cpp b/Microsoft.WindowsAzure.Storage/src/xmlhelpers.cpp index c23adc0a..1d6b43e6 100644 --- a/Microsoft.WindowsAzure.Storage/src/xmlhelpers.cpp +++ b/Microsoft.WindowsAzure.Storage/src/xmlhelpers.cpp @@ -42,7 +42,7 @@ #include "stdafx.h" #include "wascore/xmlhelpers.h" -#ifdef WIN32 +#ifdef _WIN32 #include "wascore/xmlstream.h" #else typedef int XmlNodeType; @@ -59,7 +59,7 @@ namespace azure { namespace storage { namespace core { namespace xml { void xml_reader::initialize(streams::istream stream) { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; CComPtr pInputStream; pInputStream.Attach(xmlstring_istream::create(stream)); @@ -112,7 +112,7 @@ namespace azure { namespace storage { namespace core { namespace xml { m_continueParsing = true; // read until there are no more nodes -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; XmlNodeType nodeType; while (m_continueParsing && S_OK == (hr = m_reader->Read(&nodeType))) @@ -134,7 +134,7 @@ namespace azure { namespace storage { namespace core { namespace xml { m_elementStack.push_back(name); handle_begin_element(name); -#ifdef WIN32 +#ifdef _WIN32 if (m_reader->IsEmptyElement()) #else if (m_reader->is_empty_element()) @@ -187,7 +187,7 @@ namespace azure { namespace storage { namespace core { namespace xml { utility::string_t xml_reader::get_current_element_name() { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; const wchar_t * pwszLocalName = NULL; @@ -205,7 +205,7 @@ namespace azure { namespace storage { namespace core { namespace xml { utility::string_t xml_reader::get_current_element_name_with_prefix() { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; const wchar_t * pwszName = NULL; @@ -223,7 +223,7 @@ namespace azure { namespace storage { namespace core { namespace xml { utility::string_t xml_reader::get_current_element_text() { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; const wchar_t * pwszValue; @@ -242,7 +242,7 @@ namespace azure { namespace storage { namespace core { namespace xml { bool xml_reader::move_to_first_attribute() { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; if (FAILED(hr = m_reader->MoveToFirstAttribute())) { @@ -258,7 +258,7 @@ namespace azure { namespace storage { namespace core { namespace xml { bool xml_reader::move_to_next_attribute() { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; if (FAILED(hr = m_reader->MoveToNextAttribute())) { @@ -274,7 +274,7 @@ namespace azure { namespace storage { namespace core { namespace xml { void xml_writer::initialize(std::ostream& stream) { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; CComPtr pStream; pStream.Attach(xmlstring_ostream::create(stream)); @@ -322,7 +322,7 @@ namespace azure { namespace storage { namespace core { namespace xml { void xml_writer::finalize() { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; if (FAILED(hr = m_writer->WriteEndDocument())) @@ -346,7 +346,7 @@ namespace azure { namespace storage { namespace core { namespace xml { void xml_writer::write_start_element_with_prefix(const utility::string_t& elementPrefix, const utility::string_t& elementName, const utility::string_t& namespaceName) { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; if (FAILED(hr = m_writer->WriteStartElement(elementPrefix.c_str(), elementName.c_str(), namespaceName.empty() ? NULL : namespaceName.c_str()))) { @@ -362,14 +362,17 @@ namespace azure { namespace storage { namespace core { namespace xml { else { m_elementStack.push(m_elementStack.top()->add_child(elementName, elementPrefix)); - m_elementStack.top()->set_namespace_declaration(namespaceName, elementPrefix); + if (!namespaceName.empty()) + { + m_elementStack.top()->set_namespace_declaration(namespaceName, elementPrefix); + } } #endif } void xml_writer::write_start_element(const utility::string_t& elementName, const utility::string_t& namespaceName) { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; if (FAILED(hr = m_writer->WriteStartElement(NULL, elementName.c_str(), namespaceName.empty() ? NULL : namespaceName.c_str()))) @@ -385,7 +388,7 @@ namespace azure { namespace storage { namespace core { namespace xml { void xml_writer::write_end_element() { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; if (FAILED(hr = m_writer->WriteEndElement())) @@ -401,7 +404,7 @@ namespace azure { namespace storage { namespace core { namespace xml { void xml_writer::write_full_end_element() { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; if (FAILED(hr = m_writer->WriteFullEndElement())) @@ -417,7 +420,7 @@ namespace azure { namespace storage { namespace core { namespace xml { void xml_writer::write_string(const utility::string_t& str) { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; if (FAILED(hr = m_writer->WriteString(str.c_str()))) @@ -435,7 +438,7 @@ namespace azure { namespace storage { namespace core { namespace xml { void xml_writer::write_attribute_string(const utility::string_t& prefix, const utility::string_t& name, const utility::string_t& namespaceUri, const utility::string_t& value) { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; if (FAILED(hr = m_writer->WriteAttributeString(prefix.empty() ? NULL : prefix.c_str(), @@ -467,7 +470,7 @@ namespace azure { namespace storage { namespace core { namespace xml { void xml_writer::write_element(const utility::string_t& elementName, const utility::string_t& value) { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; if (FAILED(hr = m_writer->WriteElementString(NULL, elementName.c_str(), NULL, value.c_str()))) @@ -483,7 +486,7 @@ namespace azure { namespace storage { namespace core { namespace xml { void xml_writer::write_element_with_prefix(const utility::string_t& prefix, const utility::string_t& elementName, const utility::string_t& value) { -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr; if (FAILED(hr = m_writer->WriteElementString(prefix.c_str(), elementName.c_str(), NULL, value.c_str()))) diff --git a/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v120.vcxproj b/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v120.vcxproj index e31e38d1..6cf3c7f9 100644 --- a/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v120.vcxproj +++ b/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v120.vcxproj @@ -91,6 +91,7 @@ + @@ -108,7 +109,12 @@ + + + + + @@ -155,12 +161,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + diff --git a/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v120.vcxproj.filters b/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v120.vcxproj.filters index a88d05dd..26bd3b1f 100644 --- a/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v120.vcxproj.filters +++ b/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v120.vcxproj.filters @@ -36,6 +36,9 @@ Header Files + + Header Files + @@ -122,6 +125,21 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + diff --git a/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v140.vcxproj b/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v140.vcxproj index f09609b6..f879ebfc 100644 --- a/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v140.vcxproj +++ b/Microsoft.WindowsAzure.Storage/tests/Microsoft.WindowsAzure.Storage.UnitTests.v140.vcxproj @@ -161,12 +161,12 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + diff --git a/Microsoft.WindowsAzure.Storage/tests/blob_test_base.cpp b/Microsoft.WindowsAzure.Storage/tests/blob_test_base.cpp index 16eb31a6..4a6bb536 100644 --- a/Microsoft.WindowsAzure.Storage/tests/blob_test_base.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/blob_test_base.cpp @@ -138,4 +138,5 @@ void blob_service_test_base::check_blob_properties_equal(const azure::storage::c CHECK_UTF8_EQUAL(expected.content_language(), actual.content_language()); CHECK_UTF8_EQUAL(expected.content_md5(), actual.content_md5()); CHECK_UTF8_EQUAL(expected.content_type(), actual.content_type()); + CHECK(expected.server_encrypted() == actual.server_encrypted()); } diff --git a/Microsoft.WindowsAzure.Storage/tests/cloud_append_blob_test.cpp b/Microsoft.WindowsAzure.Storage/tests/cloud_append_blob_test.cpp index 218eb091..b911ecf1 100644 --- a/Microsoft.WindowsAzure.Storage/tests/cloud_append_blob_test.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/cloud_append_blob_test.cpp @@ -511,7 +511,7 @@ SUITE(Blob) TEST_FIXTURE(append_blob_test_base, append_block_stale_properties) { azure::storage::blob_request_options options; - azure::storage::operation_context op; + azure::storage::operation_context op = m_context; m_blob.create_or_replace(azure::storage::access_condition(), options, m_context); check_blob_no_stale_property(m_blob); diff --git a/Microsoft.WindowsAzure.Storage/tests/cloud_blob_test.cpp b/Microsoft.WindowsAzure.Storage/tests/cloud_blob_test.cpp index 07c6960e..bd8a9337 100644 --- a/Microsoft.WindowsAzure.Storage/tests/cloud_blob_test.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/cloud_blob_test.cpp @@ -300,6 +300,7 @@ SUITE(Blob) CHECK(same_blob.properties().content_md5().empty()); CHECK_UTF8_EQUAL(_XPLATSTR("application/octet-stream"), same_blob.properties().content_type()); CHECK(azure::storage::lease_status::unlocked == same_blob.properties().lease_status()); + CHECK(blob.properties().server_encrypted() == same_blob.properties().server_encrypted()); std::this_thread::sleep_for(std::chrono::seconds(1)); diff --git a/Microsoft.WindowsAzure.Storage/tests/cloud_page_blob_test.cpp b/Microsoft.WindowsAzure.Storage/tests/cloud_page_blob_test.cpp index 00f76d13..c8acff64 100644 --- a/Microsoft.WindowsAzure.Storage/tests/cloud_page_blob_test.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/cloud_page_blob_test.cpp @@ -504,4 +504,83 @@ SUITE(Blob) m_context.set_response_received(std::function()); } + + TEST_FIXTURE(page_blob_test_base, page_blob_prevsnapshot) + { + m_blob.create(2048, 0, azure::storage::access_condition(), azure::storage::blob_request_options(), m_context); + + azure::storage::cloud_page_blob snapshot1 = m_blob.create_snapshot(azure::storage::cloud_metadata(), azure::storage::access_condition(), azure::storage::blob_request_options(), m_context); + auto diff = m_blob.download_page_ranges_diff(snapshot1.snapshot_time(), azure::storage::access_condition(), azure::storage::blob_request_options(), m_context); + CHECK(0 == diff.size()); + + { + utility::string_t content(2048, _XPLATSTR('A')); + auto utf8_body = utility::conversions::to_utf8string(content); + auto stream = concurrency::streams::bytestream::open_istream(std::move(utf8_body)); + m_blob.upload_pages(stream, 0, _XPLATSTR("")); + diff = m_blob.download_page_ranges_diff(snapshot1.snapshot_time(), azure::storage::access_condition(), azure::storage::blob_request_options(), m_context); + CHECK(1 == diff.size()); + CHECK_EQUAL(false, diff[0].is_cleared_rage()); + CHECK(0 == diff[0].start_offset()); + CHECK(2047 == diff[0].end_offset()); + } + + azure::storage::cloud_page_blob snapshot2 = m_blob.create_snapshot(azure::storage::cloud_metadata(), azure::storage::access_condition(), azure::storage::blob_request_options(), m_context); + auto diff2 = snapshot2.download_page_ranges_diff(snapshot1.snapshot_time(), azure::storage::access_condition(), azure::storage::blob_request_options(), m_context); + CHECK_EQUAL(false, diff[0].is_cleared_rage()); + CHECK(0 == diff[0].start_offset()); + CHECK(2047 == diff[0].end_offset()); + + { + utility::string_t content(512, _XPLATSTR('B')); + auto utf8_body = utility::conversions::to_utf8string(content); + auto stream = concurrency::streams::bytestream::open_istream(std::move(utf8_body)); + m_blob.upload_pages(stream, 0, _XPLATSTR("")); + m_blob.clear_pages(512, 512); + diff = m_blob.download_page_ranges_diff(snapshot2.snapshot_time(), azure::storage::access_condition(), azure::storage::blob_request_options(), m_context); + CHECK(2 == diff.size()); + if (diff[0].is_cleared_rage() == true) + { + auto temp = diff[0]; + diff[0] = diff[1]; + diff[1] = temp; + } + CHECK_EQUAL(false, diff[0].is_cleared_rage()); + CHECK(0 == diff[0].start_offset()); + CHECK(511 == diff[0].end_offset()); + + CHECK_EQUAL(true, diff[1].is_cleared_rage()); + CHECK(512 == diff[1].start_offset()); + CHECK(1023 == diff[1].end_offset()); + } + + azure::storage::cloud_page_blob snapshot3 = m_blob.create_snapshot(azure::storage::cloud_metadata(), azure::storage::access_condition(), azure::storage::blob_request_options(), m_context); + auto diff3 = snapshot3.download_page_ranges_diff(snapshot2.snapshot_time(), azure::storage::access_condition(), azure::storage::blob_request_options(), m_context); + CHECK(2 == diff.size()); + if (diff[0].is_cleared_rage() == true) + { + auto temp = diff[0]; + diff[0] = diff[1]; + diff[1] = temp; + } + CHECK_EQUAL(false, diff[0].is_cleared_rage()); + CHECK(0 == diff[0].start_offset()); + CHECK(511 == diff[0].end_offset()); + + CHECK_EQUAL(true, diff[1].is_cleared_rage()); + CHECK(512 == diff[1].start_offset()); + CHECK(1023 == diff[1].end_offset()); + + { + utility::string_t content(2048, _XPLATSTR('A')); + auto utf8_body = utility::conversions::to_utf8string(content); + auto stream = concurrency::streams::bytestream::open_istream(std::move(utf8_body)); + m_blob.upload_pages(stream, 0, _XPLATSTR("")); + diff = m_blob.download_page_ranges_diff(snapshot1.snapshot_time(), azure::storage::access_condition(), azure::storage::blob_request_options(), m_context); + CHECK(1 == diff.size()); + CHECK_EQUAL(false, diff[0].is_cleared_rage()); + CHECK(0 == diff[0].start_offset()); + CHECK(2047 == diff[0].end_offset()); + } + } } diff --git a/Microsoft.WindowsAzure.Storage/tests/cloud_queue_client_test.cpp b/Microsoft.WindowsAzure.Storage/tests/cloud_queue_client_test.cpp index ecfcaedc..c1a79c72 100644 --- a/Microsoft.WindowsAzure.Storage/tests/cloud_queue_client_test.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/cloud_queue_client_test.cpp @@ -129,6 +129,7 @@ SUITE(QueueClient) bool get_metadata; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); prefix = object_name_prefix; get_metadata = false; @@ -184,6 +185,7 @@ SUITE(QueueClient) bool get_metadata; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); prefix = object_name_prefix; get_metadata = true; @@ -257,7 +259,7 @@ SUITE(QueueClient) int max_results; azure::storage::continuation_token token; azure::storage::queue_request_options options; - azure::storage::operation_context context; + azure::storage::operation_context context = m_context; prefix = object_name_prefix; get_metadata = false; @@ -335,7 +337,7 @@ SUITE(QueueClient) { utility::string_t prefix = object_name_prefix; azure::storage::queue_request_options options; - azure::storage::operation_context context; + azure::storage::operation_context context = m_context; std::vector results = list_all_queues(client, prefix, false, options, context); CHECK(results.size() >= QUEUE_COUNT); } diff --git a/Microsoft.WindowsAzure.Storage/tests/cloud_queue_test.cpp b/Microsoft.WindowsAzure.Storage/tests/cloud_queue_test.cpp index 3387a2be..69896e68 100644 --- a/Microsoft.WindowsAzure.Storage/tests/cloud_queue_test.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/cloud_queue_test.cpp @@ -230,6 +230,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool exists = queue1.exists(options, context); @@ -256,6 +257,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); // It is allowed to create a queue that already exists with the same metadata queue1.create(options, context); @@ -281,6 +283,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::cloud_metadata metadata; metadata[_XPLATSTR("MyMetadata1")] = _XPLATSTR("AAA"); @@ -322,6 +325,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); queue1.delete_queue(options, context); @@ -346,6 +350,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool exists = queue1.exists(options, context); @@ -372,6 +377,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); try { @@ -413,6 +419,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool created = queue.create_if_not_exists(options, context); @@ -451,6 +458,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool exists = queue.exists(options, context); @@ -477,6 +485,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool created = queue.create_if_not_exists(options, context); @@ -503,6 +512,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool deleted = queue.delete_queue_if_exists(options, context); @@ -541,6 +551,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool exists = queue.exists(options, context); @@ -567,6 +578,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool deleted = queue.delete_queue_if_exists(options, context); @@ -599,6 +611,7 @@ SUITE(Queue) azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); CHECK_EQUAL(-1, queue.approximate_message_count()); @@ -639,6 +652,7 @@ SUITE(Queue) azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); CHECK(queue1.metadata().empty()); @@ -702,6 +716,7 @@ SUITE(Queue) queue1.metadata().erase(_XPLATSTR("ddd")); azure::storage::operation_context whitespace_metadata_context; + print_client_request_id(context, _XPLATSTR("")); whitespace_metadata_context.set_sending_request([](web::http::http_request& request, azure::storage::operation_context) { request.headers().add(_XPLATSTR("x-ms-meta-mywhitespacekey"), _XPLATSTR("")); @@ -728,6 +743,7 @@ SUITE(Queue) std::chrono::seconds visibility_timeout; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); message_count = 2U; visibility_timeout = std::chrono::seconds(1); @@ -779,6 +795,7 @@ SUITE(Queue) std::chrono::seconds initial_visibility_timeout; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); message1.set_content(content1); time_to_live = std::chrono::seconds(15 * 60); @@ -855,6 +872,7 @@ SUITE(Queue) std::chrono::seconds visibility_timeout; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); message_count = 2U; visibility_timeout = std::chrono::seconds(1); @@ -906,6 +924,7 @@ SUITE(Queue) bool update_content; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); visibility_timeout = std::chrono::seconds(15 * 60); update_content = false; @@ -944,6 +963,7 @@ SUITE(Queue) size_t message_count; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); message_count = 5U; @@ -984,6 +1004,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); queue.delete_message(message2, options, context); @@ -1015,6 +1036,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::cloud_queue_message message = queue.peek_message(options, context); @@ -1047,6 +1069,7 @@ SUITE(Queue) std::chrono::seconds visibility_timeout; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); visibility_timeout = std::chrono::seconds(15 * 60); @@ -1080,6 +1103,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::cloud_queue_message message = queue.peek_message(options, context); @@ -1112,6 +1136,7 @@ SUITE(Queue) std::chrono::seconds visibility_timeout; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); visibility_timeout = std::chrono::seconds(1); @@ -1153,6 +1178,7 @@ SUITE(Queue) bool update_content; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); message3.set_content(new_content); visibility_timeout = std::chrono::seconds(0); @@ -1191,6 +1217,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::cloud_queue_message message = queue.peek_message(options, context); @@ -1226,6 +1253,7 @@ SUITE(Queue) bool update_content; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); message3.set_content(new_content); visibility_timeout = std::chrono::seconds(0); @@ -1261,6 +1289,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::cloud_queue_message message = queue.peek_message(options, context); @@ -1292,6 +1321,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); queue.clear(options, context); @@ -1316,6 +1346,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::cloud_queue_message message = queue.peek_message(options, context); @@ -1355,6 +1386,7 @@ SUITE(Queue) azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); { azure::storage::cloud_queue_message message; @@ -1539,6 +1571,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::queue_permissions permissions = queue.download_permissions(options, context); @@ -1566,6 +1599,7 @@ SUITE(Queue) azure::storage::queue_permissions permissions; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::shared_access_policies policies; policies.insert(std::make_pair(policy_name1, policy1)); @@ -1595,6 +1629,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::queue_permissions permissions = queue.download_permissions(options, context); @@ -1628,6 +1663,7 @@ SUITE(Queue) azure::storage::queue_permissions permissions; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::shared_access_policies policies; @@ -1655,6 +1691,7 @@ SUITE(Queue) { azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::queue_permissions permissions = queue.download_permissions(options, context); @@ -1739,6 +1776,7 @@ SUITE(Queue) bool update_content; azure::storage::queue_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); visibility_timeout = std::chrono::seconds(3600); update_content = true; diff --git a/Microsoft.WindowsAzure.Storage/tests/cloud_storage_account_test.cpp b/Microsoft.WindowsAzure.Storage/tests/cloud_storage_account_test.cpp index 214be965..8755f1a1 100644 --- a/Microsoft.WindowsAzure.Storage/tests/cloud_storage_account_test.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/cloud_storage_account_test.cpp @@ -978,7 +978,7 @@ SUITE(Core) auto sas_token = account.get_shared_access_signature(policy); azure::storage::storage_credentials sas_cred(sas_token); azure::storage::cloud_blob_client sas_blob_client(account.blob_endpoint(), sas_cred); - azure::storage::operation_context op; + azure::storage::operation_context op = m_context; CHECK_THROW(sas_blob_client.list_containers(_XPLATSTR("prefix"), azure::storage::container_listing_details::none, 0, azure::storage::blob_request_options(), op), azure::storage::storage_exception); auto error_details = op.request_results().back().extended_error().details(); auto source_ip = error_details[_XPLATSTR("SourceIP")]; diff --git a/Microsoft.WindowsAzure.Storage/tests/cloud_table_client_test.cpp b/Microsoft.WindowsAzure.Storage/tests/cloud_table_client_test.cpp index 3f2d169f..63ee0270 100644 --- a/Microsoft.WindowsAzure.Storage/tests/cloud_table_client_test.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/cloud_table_client_test.cpp @@ -124,7 +124,7 @@ SUITE(TableClient) utility::string_t prefix; azure::storage::table_request_options options; - azure::storage::operation_context context; + azure::storage::operation_context context = m_context; prefix = object_name_prefix; @@ -195,7 +195,7 @@ SUITE(TableClient) int max_results; azure::storage::continuation_token token; azure::storage::table_request_options options; - azure::storage::operation_context context; + azure::storage::operation_context context = m_context; prefix = object_name_prefix; max_results = 3; @@ -275,7 +275,7 @@ SUITE(TableClient) utility::string_t prefix = object_name_prefix; azure::storage::table_request_options options; - azure::storage::operation_context context; + azure::storage::operation_context context = m_context; std::vector results = list_all_tables(client, prefix, options, context); CHECK(results.size() >= TABLE_COUNT); diff --git a/Microsoft.WindowsAzure.Storage/tests/cloud_table_test.cpp b/Microsoft.WindowsAzure.Storage/tests/cloud_table_test.cpp index c0ec29a5..9986b857 100644 --- a/Microsoft.WindowsAzure.Storage/tests/cloud_table_test.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/cloud_table_test.cpp @@ -905,6 +905,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); table.create(options, context); @@ -929,6 +930,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool exists = table.exists(options, context); @@ -955,6 +957,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); try { @@ -988,6 +991,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); table.delete_table(options, context); @@ -1012,6 +1016,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool exists = table.exists(options, context); @@ -1038,6 +1043,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); try { @@ -1079,6 +1085,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool created = table.create_if_not_exists(options, context); @@ -1117,6 +1124,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool exists = table.exists(options, context); @@ -1143,6 +1151,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool created = table.create_if_not_exists(options, context); @@ -1169,6 +1178,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool deleted = table.delete_table_if_exists(options, context); @@ -1207,6 +1217,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool exists = table.exists(options, context); @@ -1233,6 +1244,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); bool deleted = table.delete_table_if_exists(options, context); @@ -1279,6 +1291,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::insert_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); try { @@ -1341,6 +1354,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::insert_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -1373,6 +1387,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::retrieve_entity(partition_key, row_key); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -1435,6 +1450,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::insert_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); try { @@ -1474,6 +1490,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::delete_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -1506,6 +1523,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::retrieve_entity(partition_key, row_key); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -1540,6 +1558,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::delete_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); try { @@ -1605,6 +1624,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::insert_or_merge_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -1637,6 +1657,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::retrieve_entity(partition_key, row_key); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -1709,6 +1730,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::insert_or_merge_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -1741,6 +1763,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::retrieve_entity(partition_key, row_key); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -1817,6 +1840,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::merge_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -1849,6 +1873,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::retrieve_entity(partition_key, row_key); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -1909,6 +1934,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::delete_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -1963,6 +1989,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::merge_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); try { @@ -2028,6 +2055,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::insert_or_replace_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -2060,6 +2088,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::retrieve_entity(partition_key, row_key); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -2132,6 +2161,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::insert_or_replace_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -2164,6 +2194,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::retrieve_entity(partition_key, row_key); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -2236,6 +2267,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::replace_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -2268,6 +2300,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::retrieve_entity(partition_key, row_key); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -2320,6 +2353,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::delete_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -2374,6 +2408,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::replace_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); try { @@ -2439,6 +2474,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::insert_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); options.set_server_timeout(std::chrono::seconds(20)); @@ -2473,6 +2509,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::retrieve_entity(partition_key, row_key); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); options.set_server_timeout(std::chrono::seconds(20)); @@ -2543,6 +2580,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::insert_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); try { @@ -2612,6 +2650,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::insert_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -2627,6 +2666,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::retrieve_entity(partition_key, row_key); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -2719,6 +2759,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); for (int i = 0; i < BATCH_SIZE; ++i) { @@ -2768,6 +2809,7 @@ SUITE(Table) azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); utility::string_t filter_string = azure::storage::table_query::generate_filter_condition(_XPLATSTR("PartitionKey"), azure::storage::query_comparison_operator::equal, partition_key); query.set_filter_string(filter_string); @@ -2808,6 +2850,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); for (int i = 0; i < BATCH_SIZE; ++i) { @@ -2858,6 +2901,7 @@ SUITE(Table) azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); utility::string_t filter_string = azure::storage::table_query::generate_filter_condition(_XPLATSTR("PartitionKey"), azure::storage::query_comparison_operator::equal, partition_key); query.set_filter_string(filter_string); @@ -2899,6 +2943,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); for (int i = 0; i < BATCH_SIZE; ++i) { @@ -2949,6 +2994,7 @@ SUITE(Table) azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); utility::string_t filter_string = azure::storage::table_query::generate_filter_condition(_XPLATSTR("PartitionKey"), azure::storage::query_comparison_operator::equal, partition_key); query.set_filter_string(filter_string); @@ -2990,6 +3036,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); for (int i = 0; i < BATCH_SIZE; ++i) { @@ -3039,6 +3086,7 @@ SUITE(Table) azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); utility::string_t filter_string = azure::storage::table_query::generate_filter_condition(_XPLATSTR("PartitionKey"), azure::storage::query_comparison_operator::equal, partition_key); query.set_filter_string(filter_string); @@ -3079,6 +3127,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); for (int i = 0; i < BATCH_SIZE; ++i) { @@ -3128,6 +3177,7 @@ SUITE(Table) azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); utility::string_t filter_string = azure::storage::table_query::generate_filter_condition(_XPLATSTR("PartitionKey"), azure::storage::query_comparison_operator::equal, partition_key); query.set_filter_string(filter_string); @@ -3168,6 +3218,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); operation.retrieve_entity(partition_key, row_keys[i]); @@ -3206,6 +3257,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); for (int i = 0; i < BATCH_SIZE; ++i) { @@ -3253,6 +3305,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); operation.retrieve_entity(partition_key, row_keys[i]); @@ -3302,6 +3355,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::entity_property bad_property = azure::storage::entity_property(get_random_int32()); bad_property.set_property_type(azure::storage::edm_type::datetime); @@ -3349,6 +3403,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); utility::string_t bad_row_key = _XPLATSTR("bad//key"); @@ -3398,6 +3453,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_entity entity1(partition_key1, row_key1); operation.insert_entity(entity1); @@ -3419,6 +3475,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); operation.retrieve_entity(partition_key, row_key1); operation.retrieve_entity(partition_key, row_key2); @@ -3437,6 +3494,7 @@ SUITE(Table) azure::storage::table_batch_operation operation; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); operation.retrieve_entity(partition_key, row_key1); @@ -3506,17 +3564,18 @@ SUITE(Table) // Explicit checks to ensure that UUIDs behave as we would expect per platform // After this check, we can jsut use converted_uuid_string. -#ifdef WIN32 +#ifdef _WIN32 CHECK(uuid_string.compare(converted_uuid_string) == 0); #else utility::string_t capital_uuid_string = _XPLATSTR("12345678-ABCD-EFAB-CDEF-1234567890AB"); CHECK((capital_uuid_string).compare(converted_uuid_string) == 0); -#endif // WIN32 +#endif // _WIN32 { azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); int take_count = 10; query.set_take_count(take_count); @@ -3630,6 +3689,7 @@ SUITE(Table) azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); int take_count = 10; query.set_take_count(take_count); @@ -3804,6 +3864,7 @@ SUITE(Table) azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); int take_count = 10; query.set_take_count(take_count); @@ -3918,6 +3979,7 @@ SUITE(Table) azure::storage::continuation_token token; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); int take_count = 10; query.set_take_count(take_count); @@ -4047,6 +4109,7 @@ SUITE(Table) azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); utility::string_t filter_string = azure::storage::table_query::generate_filter_condition(_XPLATSTR("PartitionKey"), azure::storage::query_comparison_operator::equal, partition_key); query.set_filter_string(filter_string); @@ -4089,6 +4152,7 @@ SUITE(Table) azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); // An invalid filter string because PartitionKey is not a numeric type utility::string_t filter_string = (_XPLATSTR("PartitionKey eq 12345")); @@ -4167,6 +4231,7 @@ SUITE(Table) azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); utility::string_t filter_string = azure::storage::table_query::generate_filter_condition(_XPLATSTR("TextProperty"), azure::storage::query_comparison_operator::equal, property_value); query.set_filter_string(filter_string); @@ -4245,6 +4310,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_permissions permissions = table.download_permissions(options, context); @@ -4272,6 +4338,7 @@ SUITE(Table) azure::storage::table_permissions permissions; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::shared_access_policies policies; policies.insert(std::make_pair(policy_name1, policy1)); @@ -4301,6 +4368,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_permissions permissions = table.download_permissions(options, context); @@ -4334,6 +4402,7 @@ SUITE(Table) azure::storage::table_permissions permissions; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::shared_access_policies policies; @@ -4361,6 +4430,7 @@ SUITE(Table) { azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_permissions permissions = table.download_permissions(options, context); @@ -4493,6 +4563,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::insert_entity(entity); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -4525,6 +4596,7 @@ SUITE(Table) azure::storage::table_operation operation = azure::storage::table_operation::retrieve_entity(partition_key, row_key); azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); azure::storage::table_result result = table.execute(operation, options, context); @@ -4562,6 +4634,7 @@ SUITE(Table) azure::storage::table_query query; azure::storage::table_request_options options; azure::storage::operation_context context; + print_client_request_id(context, _XPLATSTR("")); utility::string_t filter_string = azure::storage::table_query::generate_filter_condition(_XPLATSTR("PropertyA"), azure::storage::query_comparison_operator::equal, truncated_value); query.set_filter_string(filter_string); diff --git a/Microsoft.WindowsAzure.Storage/tests/executor_test.cpp b/Microsoft.WindowsAzure.Storage/tests/executor_test.cpp index a9cf560d..70636229 100644 --- a/Microsoft.WindowsAzure.Storage/tests/executor_test.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/executor_test.cpp @@ -28,7 +28,7 @@ SUITE(Core) utility::string_t timeout; - azure::storage::operation_context context; + azure::storage::operation_context context = m_context; context.set_sending_request([&timeout] (web::http::http_request& request, azure::storage::operation_context context) mutable { std::map query_parameters = web::http::uri::split_query(request.request_uri().query()); @@ -72,7 +72,7 @@ SUITE(Core) auto start_time = utility::datetime::utc_now(); std::this_thread::sleep_for(std::chrono::milliseconds(10)); - azure::storage::operation_context context; + azure::storage::operation_context context = m_context; context.set_client_request_id(_XPLATSTR("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")); context.user_headers().add(_XPLATSTR("x-ms-test-key"), _XPLATSTR("test-value")); context.set_sending_request([&client_request_id, &test_key] (web::http::http_request& request, azure::storage::operation_context context) mutable diff --git a/Microsoft.WindowsAzure.Storage/tests/main.cpp b/Microsoft.WindowsAzure.Storage/tests/main.cpp index a5b3cbe8..2e6f4af9 100644 --- a/Microsoft.WindowsAzure.Storage/tests/main.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/main.cpp @@ -19,7 +19,7 @@ #include "was/blob.h" -#ifndef WIN32 +#ifndef _WIN32 #include #include @@ -44,7 +44,7 @@ int main(int argc, const char* argv[]) { azure::storage::operation_context::set_default_log_level(azure::storage::client_log_level::log_level_verbose); -#ifndef WIN32 +#ifndef _WIN32 boost::log::add_common_attributes(); boost::log::add_file_log ( diff --git a/Microsoft.WindowsAzure.Storage/tests/packages.config b/Microsoft.WindowsAzure.Storage/tests/packages.config index ebd30628..f08160b6 100644 --- a/Microsoft.WindowsAzure.Storage/tests/packages.config +++ b/Microsoft.WindowsAzure.Storage/tests/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/Microsoft.WindowsAzure.Storage/tests/retry_policy_test.cpp b/Microsoft.WindowsAzure.Storage/tests/retry_policy_test.cpp index bf470700..fb595cc2 100644 --- a/Microsoft.WindowsAzure.Storage/tests/retry_policy_test.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/retry_policy_test.cpp @@ -68,12 +68,12 @@ azure::storage::storage_location get_next_location(azure::storage::location_mode } } -void verify_retry_results(azure::storage::retry_policy policy, web::http::status_code primary_status_code, web::http::status_code secondary_status_code, azure::storage::location_mode mode, std::function allowed_delta, std::vector expected_retry_info_list) +void verify_retry_results(azure::storage::retry_policy policy, web::http::status_code primary_status_code, web::http::status_code secondary_status_code, azure::storage::location_mode mode, std::function allowed_delta, std::vector expected_retry_info_list, azure::storage::operation_context context) { auto initial_location = get_initial_location(mode); auto next_location = get_next_location(mode, initial_location); - azure::storage::operation_context op_context; + azure::storage::operation_context op_context = context; azure::storage::request_result result(utility::datetime::utc_now(), initial_location, web::http::http_response(initial_location == azure::storage::storage_location::secondary ? secondary_status_code : primary_status_code), @@ -119,7 +119,7 @@ SUITE(Core) CHECK(!null_policy.is_valid()); azure::storage::retry_context dummy_context(0, azure::storage::request_result(), azure::storage::storage_location::primary, azure::storage::location_mode::primary_only); - azure::storage::retry_info info = null_policy.evaluate(dummy_context, azure::storage::operation_context()); + azure::storage::retry_info info = null_policy.evaluate(dummy_context, m_context); CHECK(!info.should_retry()); CHECK(info.target_location() == azure::storage::storage_location::unspecified); CHECK(info.updated_location_mode() == azure::storage::location_mode::unspecified); @@ -169,25 +169,25 @@ SUITE(Core) { azure::storage::no_retry_policy policy; std::vector expected_retry_info_list; - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_only, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_only, allowed_delta, expected_retry_info_list, m_context); } { azure::storage::no_retry_policy policy; std::vector expected_retry_info_list; - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list, m_context); } { azure::storage::no_retry_policy policy; std::vector expected_retry_info_list; - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list, m_context); } { azure::storage::no_retry_policy policy; std::vector expected_retry_info_list; - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list, m_context); } // Primary location returns InternalError, while secondary location returns NotFound @@ -195,19 +195,19 @@ SUITE(Core) { azure::storage::no_retry_policy policy; std::vector expected_retry_info_list; - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list, m_context); } { azure::storage::no_retry_policy policy; std::vector expected_retry_info_list; - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list, m_context); } { azure::storage::no_retry_policy policy; std::vector expected_retry_info_list; - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list, m_context); } } @@ -227,7 +227,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(4))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(6))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(10))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_only, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_only, allowed_delta, expected_retry_info_list, m_context); } { @@ -237,7 +237,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(4))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(6))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(10))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list, m_context); } { @@ -247,7 +247,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_then_secondary, std::chrono::seconds(4))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::primary_then_secondary, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_then_secondary, std::chrono::seconds(8))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list, m_context); } { @@ -257,7 +257,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_then_primary, std::chrono::seconds(4))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::secondary_then_primary, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_then_primary, std::chrono::seconds(8))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list, m_context); } // Primary location returns InternalError, while secondary location returns NotFound @@ -269,7 +269,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(4))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(6))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(10))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list, m_context); } { @@ -279,7 +279,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(4))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(6))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(10))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list, m_context); } { @@ -289,7 +289,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(4))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(6))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(10))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list, m_context); } } @@ -309,7 +309,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(2))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_only, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_only, allowed_delta, expected_retry_info_list, m_context); } { @@ -319,7 +319,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(2))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list, m_context); } { @@ -329,7 +329,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_then_secondary, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::primary_then_secondary, std::chrono::seconds(0))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_then_secondary, std::chrono::seconds(2))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list, m_context); } { @@ -339,7 +339,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_then_primary, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::secondary_then_primary, std::chrono::seconds(0))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_then_primary, std::chrono::seconds(2))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::InternalError, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list, m_context); } // Primary location returns InternalError, while secondary location returns NotFound @@ -351,7 +351,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::secondary, azure::storage::location_mode::secondary_only, std::chrono::seconds(2))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_only, allowed_delta, expected_retry_info_list, m_context); } { @@ -361,7 +361,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(2))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::primary_then_secondary, allowed_delta, expected_retry_info_list, m_context); } { @@ -371,7 +371,7 @@ SUITE(Core) expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(2))); expected_retry_info_list.push_back(create_fake_retry_info(azure::storage::storage_location::primary, azure::storage::location_mode::primary_only, std::chrono::seconds(2))); - verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list); + verify_retry_results(policy, web::http::status_codes::InternalError, web::http::status_codes::NotFound, azure::storage::location_mode::secondary_then_primary, allowed_delta, expected_retry_info_list, m_context); } } diff --git a/Microsoft.WindowsAzure.Storage/tests/storage_exception_test.cpp b/Microsoft.WindowsAzure.Storage/tests/storage_exception_test.cpp index 851c8dc8..749f618b 100644 --- a/Microsoft.WindowsAzure.Storage/tests/storage_exception_test.cpp +++ b/Microsoft.WindowsAzure.Storage/tests/storage_exception_test.cpp @@ -53,7 +53,7 @@ SUITE(Core) azure::storage::cloud_table table = client.get_table_reference(table_name); azure::storage::table_request_options options; - azure::storage::operation_context context; + azure::storage::operation_context context = m_context; try { table.delete_table(options, context); @@ -73,7 +73,7 @@ SUITE(Core) azure::storage::cloud_table table = client.get_table_reference(table_name); azure::storage::table_request_options options; - azure::storage::operation_context context; + azure::storage::operation_context context = m_context; context.set_sending_request([](web::http::http_request &r, azure::storage::operation_context) { r.headers()[_XPLATSTR("Accept")] = _XPLATSTR("application/xml"); }); diff --git a/Microsoft.WindowsAzure.Storage/tests/targetver.h b/Microsoft.WindowsAzure.Storage/tests/targetver.h index 0f73f169..a275b907 100644 --- a/Microsoft.WindowsAzure.Storage/tests/targetver.h +++ b/Microsoft.WindowsAzure.Storage/tests/targetver.h @@ -22,6 +22,6 @@ // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. -#ifdef WIN32 +#ifdef _WIN32 #include #endif diff --git a/Microsoft.WindowsAzure.Storage/version.rc b/Microsoft.WindowsAzure.Storage/version.rc index 2340d4d6..91ed4e1c 100644 Binary files a/Microsoft.WindowsAzure.Storage/version.rc and b/Microsoft.WindowsAzure.Storage/version.rc differ diff --git a/README.md b/README.md index 724ef2d2..90e40d07 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Azure Storage Client Library for C++ (2.4.0) +# Azure Storage Client Library for C++ (2.5.0) The Azure Storage Client Library for C++ allows you to build applications against Microsoft Azure Storage. For an overview of Azure Storage, see [Introduction to Microsoft Azure Storage](http://azure.microsoft.com/en-us/documentation/articles/storage-introduction/). @@ -65,7 +65,7 @@ Starting from version 2.1.0, Azure Storage Client Library for C++ supports Visua ### C++ REST SDK -The Azure Storage Client Library for C++ depends on the C++ REST SDK (codename "Casablanca") 2.8.0. It can be installed through [NuGet](https://www.nuget.org/packages/cpprestsdk/2.8.0) or downloaded directly from [GitHub](https://github.com/Microsoft/cpprestsdk/releases/tag/v2.8.0). +The Azure Storage Client Library for C++ depends on the C++ REST SDK (codename "Casablanca") 2.9.1. It can be installed through [NuGet](https://www.nuget.org/packages/cpprestsdk/2.9.1) or downloaded directly from [GitHub](https://github.com/Microsoft/cpprestsdk/releases/tag/v2.9.1). ## Code Samples @@ -77,7 +77,7 @@ To get started with the coding, please visit the following articles: To accomplish specific tasks, please find the code samples at [samples folder](Microsoft.WindowsAzure.Storage/samples). ## Getting Started on Linux -As mentioned above, the Azure Storage Client Library for C++ depends on Casablanca. Follow [these instructions](https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-Linux) to compile it. Current version of the library depends on Casablanca version 2.8.0. +As mentioned above, the Azure Storage Client Library for C++ depends on Casablanca. Follow [these instructions](https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-Linux) to compile it. Current version of the library depends on Casablanca version 2.9.1. Once this is complete, then: @@ -154,7 +154,7 @@ If you are using homebrew you can install it from there: brew install cpprestsdk ``` -Otherwise, you may need to build it. Follow [these instructions](https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-Mac-OS-X) to compile it. Current version of the library depends on Casablanca version 2.8.0. +Otherwise, you may need to build it. Follow [these instructions](https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-Mac-OS-X) to compile it. Current version of the library depends on Casablanca version 2.9.1. Once this is complete, then: diff --git a/wastorage.nuspec b/wastorage.nuspec index a8d46844..10b415a6 100644 --- a/wastorage.nuspec +++ b/wastorage.nuspec @@ -2,7 +2,7 @@ wastorage - 2.4.0 + 2.5.0 Microsoft Azure Storage Client Library for C++ Microsoft Corporation Microsoft Corporation @@ -14,8 +14,8 @@ Public release Microsoft Azure Storage Table Blob Queue File Scalable windowsazureofficial - - + + diff --git a/wastorage.v120.nuspec b/wastorage.v120.nuspec index 3b7ea6e0..157b5e85 100644 --- a/wastorage.v120.nuspec +++ b/wastorage.v120.nuspec @@ -2,7 +2,7 @@ wastorage.v120 - 2.4.0 + 2.5.0 Microsoft Azure Storage Client Library for C++ Microsoft Corporation Microsoft Corporation @@ -14,7 +14,7 @@ Public release Microsoft Azure Storage Table Blob Queue File Scalable windowsazureofficial - + diff --git a/wastorage.v140.nuspec b/wastorage.v140.nuspec index 01f75356..4f95d41d 100644 --- a/wastorage.v140.nuspec +++ b/wastorage.v140.nuspec @@ -2,7 +2,7 @@ wastorage.v140 - 2.4.0 + 2.5.0 Microsoft Azure Storage Client Library for C++ Microsoft Corporation Microsoft Corporation @@ -14,7 +14,7 @@ Public release Microsoft Azure Storage Table Blob Queue File Scalable windowsazureofficial - +