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

Commit 91878b1

Browse files
EmmaZhuvinjiang
authored andcommitted
Refine initialization.
1 parent 45e6eb7 commit 91878b1

File tree

9 files changed

+39
-10
lines changed

9 files changed

+39
-10
lines changed

Microsoft.WindowsAzure.Storage/includes/was/blob.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,10 @@ namespace azure { namespace storage {
12511251
m_server_encrypted(false),
12521252
m_is_incremental_copy(false)
12531253
{
1254+
m_standard_blob_tier = azure::storage::standard_blob_tier::unknown;
1255+
m_premium_blob_tier = azure::storage::premium_blob_tier::unknown;
1256+
m_archive_status = azure::storage::archive_status::unknown;
1257+
m_access_tier_inferred = false;
12541258
}
12551259

12561260
#if defined(_MSC_VER) && _MSC_VER < 1900

Microsoft.WindowsAzure.Storage/includes/was/common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ namespace azure { namespace storage {
808808
/// Initializes a new instance of the <see cref="azure::storage::service_properties::metrics_properties" /> class.
809809
/// </summary>
810810
metrics_properties()
811-
: m_include_apis(false), m_retention_enabled(false), m_retention_days(0)
811+
: m_enabled(false), m_include_apis(false), m_retention_enabled(false), m_retention_days(0)
812812
{
813813
}
814814

@@ -953,7 +953,7 @@ namespace azure { namespace storage {
953953
/// <summary>
954954
/// Initializes a new instance of the <see cref="azure::storage::service_properties::cors_rule" /> class.
955955
/// </summary>
956-
cors_rule()
956+
cors_rule() : m_max_age(0)
957957
{
958958
}
959959

@@ -1736,7 +1736,7 @@ namespace azure { namespace storage {
17361736
web::http::http_headers m_user_headers;
17371737
utility::datetime m_start_time;
17381738
utility::datetime m_end_time;
1739-
client_log_level m_log_level;
1739+
client_log_level m_log_level = client_log_level::log_level_off;
17401740
web::web_proxy m_proxy;
17411741
std::vector<request_result> m_request_results;
17421742
pplx::extensibility::critical_section_t m_request_results_lock;

Microsoft.WindowsAzure.Storage/includes/was/core.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,8 @@ namespace azure { namespace storage {
595595
: m_is_response_available(false),
596596
m_target_location(storage_location::unspecified),
597597
m_http_status_code(0),
598-
m_content_length(std::numeric_limits<utility::size64_t>::max())
598+
m_content_length(std::numeric_limits<utility::size64_t>::max()),
599+
m_request_server_encrypted(false)
599600
{
600601
}
601602

@@ -610,7 +611,8 @@ namespace azure { namespace storage {
610611
m_target_location(target_location),
611612
m_end_time(utility::datetime::utc_now()),
612613
m_http_status_code(0),
613-
m_content_length(std::numeric_limits<utility::size64_t>::max())
614+
m_content_length(std::numeric_limits<utility::size64_t>::max()),
615+
m_request_server_encrypted(false)
614616
{
615617
}
616618

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ namespace azure { namespace storage { namespace core {
160160

161161
explicit storage_command_base(const storage_uri& request_uri, const pplx::cancellation_token& cancellation_token, const bool use_timeout, std::shared_ptr<core::timer_handler> timer_handler)
162162
: m_request_uri(request_uri), m_location_mode(command_location_mode::primary_only),
163-
m_cancellation_token(cancellation_token), m_use_timeout(use_timeout), m_timer_handler(timer_handler)
163+
m_cancellation_token(cancellation_token), m_calculate_response_body_md5(false), m_use_timeout(use_timeout), m_timer_handler(timer_handler)
164164
{
165165
if (m_use_timeout)
166166
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace azure { namespace storage { namespace core {
5656
public:
5757
basic_cloud_ostreambuf()
5858
: basic_ostreambuf<concurrency::streams::ostream::traits::char_type>(),
59-
m_current_streambuf_offset(0), m_committed(false)
59+
m_current_streambuf_offset(0), m_committed(false), m_buffer_size(0), m_next_buffer_size(0)
6060
{
6161
}
6262

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,12 @@ class xml_writer
207207
virtual ~xml_writer() {}
208208

209209
protected:
210+
211+
#ifdef _WIN32
210212
xml_writer()
213+
#else // LINUX
214+
xml_writer() :m_stream(nullptr)
215+
#endif
211216
{
212217
}
213218

Microsoft.WindowsAzure.Storage/src/timer_handler.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,19 @@ namespace azure { namespace storage { namespace core {
4040
{
4141
m_cancellation_token.deregister_callback(m_cancellation_token_registration);
4242
}
43+
44+
#ifdef _WIN32
4345
stop_timer();
46+
#else // LINUX
47+
try
48+
{
49+
stop_timer();
50+
}
51+
catch (boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> > &e)
52+
{
53+
}
54+
#endif
55+
4456
}
4557

4658
void timer_handler::start_timer(const std::chrono::milliseconds& time)

Microsoft.WindowsAzure.Storage/src/xml_wrapper.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,25 @@ bool xml_text_reader_wrapper::is_empty_element()
6666
std::string xml_text_reader_wrapper::get_local_name()
6767
{
6868
auto xml_char = xmlTextReaderLocalName(m_reader);
69-
auto result = xml_char_to_string(xml_char);
69+
std::string result;
70+
7071
if (xml_char != nullptr)
7172
{
73+
result = xml_char_to_string(xml_char);
7274
xmlFree(xml_char);
7375
}
76+
7477
return result;
7578
}
7679

7780
std::string xml_text_reader_wrapper::get_value()
7881
{
7982
auto xml_char = xmlTextReaderValue(m_reader);
80-
auto result = xml_char_to_string(xml_char);
83+
std::string result;
84+
8185
if (xml_char != nullptr)
8286
{
87+
result = xml_char_to_string(xml_char);
8388
xmlFree(xml_char);
8489
}
8590
return result;

Microsoft.WindowsAzure.Storage/src/xmlhelpers.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ namespace azure { namespace storage { namespace core { namespace xml {
355355
}
356356
#else // LINUX
357357
auto result = m_document->write_to_string();
358-
*m_stream << reinterpret_cast<const char *>(result.c_str());
358+
if (m_stream != nullptr)
359+
*m_stream << reinterpret_cast<const char *>(result.c_str());
359360

360361
#endif
361362
}

0 commit comments

Comments
 (0)