Skip to content

Commit

Permalink
Code review comments for 952a0e22
Browse files Browse the repository at this point in the history
Conflicts:
	Release/src/http/client/http_client.cpp
  • Loading branch information
ras0219-msft committed Apr 14, 2016
1 parent ba2adb3 commit 479ebe7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
6 changes: 2 additions & 4 deletions Release/include/cpprest/http_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1337,14 +1337,12 @@ class http_pipeline_stage : public std::enable_shared_from_this<http_pipeline_st
{
public:

http_pipeline_stage() {}
http_pipeline_stage() = default;

http_pipeline_stage & operator=(const http_pipeline_stage &) = delete;
http_pipeline_stage(const http_pipeline_stage &) = delete;

virtual ~http_pipeline_stage()
{
}
virtual ~http_pipeline_stage() = default;

/// <summary>
/// Runs this stage against the given request and passes onto the next stage.
Expand Down
2 changes: 1 addition & 1 deletion Release/src/http/client/http_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace details
{

#if defined(_WIN32)
const utility::char_t * get_with_body_err_msg = _XPLATSTR("A GET or HEAD request should not have an entity body.");
extern const utility::char_t * get_with_body_err_msg = _XPLATSTR("A GET or HEAD request should not have an entity body.");
#endif

void request_context::complete_headers()
Expand Down
7 changes: 3 additions & 4 deletions Release/src/http/client/http_client_winhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ class winhttp_client : public _http_client_communicator
, m_hSession(nullptr)
, m_hConnection(nullptr) { }

winhttp_client(const winhttp_client&) = delete;
winhttp_client &operator=(const winhttp_client&) = delete;

// Closes session.
~winhttp_client()
{
Expand Down Expand Up @@ -1289,10 +1292,6 @@ class winhttp_client : public _http_client_communicator
HINTERNET m_hSession;
HINTERNET m_hConnection;
bool m_secure;

// No copy or assignment.
winhttp_client(const winhttp_client&) = delete;
winhttp_client &operator=(const winhttp_client&) = delete;
};

std::shared_ptr<_http_client_communicator> create_platform_final_pipeline_stage(uri base_uri, const http_client_config& client_config)
Expand Down
9 changes: 3 additions & 6 deletions Release/src/http/client/http_client_winrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ class winrt_client : public _http_client_communicator
winrt_client(http::uri address, http_client_config client_config)
: _http_client_communicator(std::move(address), std::move(client_config)) { }

winrt_client(const winrt_client&) = delete;
winrt_client &operator=(const winrt_client&) = delete;

virtual pplx::task<http_response> propagate(http_request request) override
{
auto self = std::static_pointer_cast<_http_client_communicator>(shared_from_this());
Expand Down Expand Up @@ -555,12 +558,6 @@ class winrt_client : public _http_client_communicator
});
}
}

private:

// No copy or assignment.
winrt_client(const winrt_client&) = delete;
winrt_client &operator=(const winrt_client&) = delete;
};

std::shared_ptr<_http_client_communicator> create_platform_final_pipeline_stage(uri base_uri, const http_client_config& client_config)
Expand Down
10 changes: 5 additions & 5 deletions Release/src/http/common/http_msg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ utility::string_t http_headers::content_type() const
/// Helper functions to convert a series of bytes from a charset to utf-8 or utf-16.
/// These APIs deal with checking for and handling byte order marker (BOM).
namespace {
enum endian_ness
enum endianness
{
little_endian,
big_endian,
unknown
};
endian_ness check_byte_order_mark(const utf16string &str)
endianness check_byte_order_mark(const utf16string &str)
{
if (str.empty())
{
return unknown;
}
const unsigned char *src = (const unsigned char *) &str[0];
const unsigned char *src = reinterpret_cast<const unsigned char *>(str.data());

// little endian
if (src[0] == 0xFF && src[1] == 0xFE)
Expand Down Expand Up @@ -142,7 +142,7 @@ namespace {

std::string convert_utf16_to_utf8(utf16string src)
{
const endian_ness endian = check_byte_order_mark(src);
const endianness endian = check_byte_order_mark(src);
switch (endian)
{
case little_endian:
Expand All @@ -158,7 +158,7 @@ namespace {

utf16string convert_utf16_to_utf16(utf16string src)
{
const endian_ness endian = check_byte_order_mark(src);
const endianness endian = check_byte_order_mark(src);
switch (endian)
{
case little_endian:
Expand Down

0 comments on commit 479ebe7

Please sign in to comment.