Skip to content

Commit

Permalink
Remove unnecessary formatting changes to reduce diff - introduced dur…
Browse files Browse the repository at this point in the history
…ing merge due to auto format extension
  • Loading branch information
atbagga committed Oct 27, 2021
1 parent 68c40a7 commit 32cb396
Show file tree
Hide file tree
Showing 6 changed files with 332 additions and 349 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ LeonidCSIT
kreuzerkrieg
evanc
Jesse Towner (jwtowner)
Atul Bagga (atbagga)

Abinsula s.r.l.
Gianfranco Costamagna (LocutusOfBorg)
Expand Down
75 changes: 36 additions & 39 deletions Release/include/cpprest/certificate_info.h
Original file line number Diff line number Diff line change
@@ -1,48 +1,45 @@
/***
* ==++==
*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ==--==
* =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
*
* Certificate info
*
* For the latest on this and related APIs, please see: https://github.com/Microsoft/cpprestsdk
*
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
****/
* Copyright (C) Microsoft. All rights reserved.
* Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
*
* =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
*
* Certificate info
*
* For the latest on this and related APIs, please see: https://github.com/Microsoft/cpprestsdk
*
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
****/

#pragma once

#include <vector>
#include <string>
#include <vector>

namespace web { namespace http { namespace client {

using CertificateChain = std::vector<std::vector<unsigned char>>;

struct certificate_info
namespace web
{
namespace http
{
namespace client
{
using CertificateChain = std::vector<std::vector<unsigned char>>;

struct certificate_info
{
std::string host_name;
CertificateChain certificate_chain;
long certificate_error {0};
bool verified {false};

certificate_info(const std::string host) : host_name(host) { }
certificate_info(const std::string host, CertificateChain chain, long error = 0)
: host_name(host), certificate_chain(chain), certificate_error(error)
{
std::string host_name;
CertificateChain certificate_chain;
long certificate_error{ 0 };
bool verified{ false };

certificate_info(const std::string host) : host_name(host) {}
certificate_info(const std::string host, CertificateChain chain, long error = 0) : host_name(host), certificate_chain(chain), certificate_error(error) {}
};
}
};

using CertificateChainFunction = std::function<bool(const std::shared_ptr<certificate_info> certificate_Info)>;
using CertificateChainFunction = std::function<bool(const std::shared_ptr<certificate_info> certificate_Info)>;

}}}
} // namespace client
} // namespace http
} // namespace web
8 changes: 4 additions & 4 deletions Release/include/cpprest/oauth2.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ namespace experimental
class oauth2_exception : public std::exception
{
public:
oauth2_exception(utility::string_t msg) : m_msg(utility::conversions::to_utf8string(std::move(msg))) { }
~oauth2_exception() CPPREST_NOEXCEPT { }
oauth2_exception(utility::string_t msg) : m_msg(utility::conversions::to_utf8string(std::move(msg))) {}
~oauth2_exception() CPPREST_NOEXCEPT {}
const char* what() const CPPREST_NOEXCEPT { return m_msg.c_str(); }

private:
Expand Down Expand Up @@ -503,7 +503,7 @@ class oauth2_config
friend class web::http::client::http_client_config;
friend class web::http::oauth2::details::oauth2_handler;

oauth2_config() : m_implicit_grant(false), m_bearer_auth(true), m_http_basic_auth(true) { }
oauth2_config() : m_implicit_grant(false), m_bearer_auth(true), m_http_basic_auth(true) {}

_ASYNCRTIMP pplx::task<void> _request_token(uri_builder& request_body);

Expand Down Expand Up @@ -553,7 +553,7 @@ namespace details
class oauth2_handler : public http_pipeline_stage
{
public:
oauth2_handler(std::shared_ptr<experimental::oauth2_config> cfg) : m_config(std::move(cfg)) { }
oauth2_handler(std::shared_ptr<experimental::oauth2_config> cfg) : m_config(std::move(cfg)) {}

virtual pplx::task<http_response> propagate(http_request request) override
{
Expand Down
37 changes: 17 additions & 20 deletions Release/include/cpprest/ws_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ class websocket_client_config
}

private:
http::client::CertificateChainFunction m_certificate_chain_callback;
web::web_proxy m_proxy;
web::credentials m_credentials;
web::http::http_headers m_headers;
Expand All @@ -237,8 +236,8 @@ class websocket_client_config
bool m_validate_certificates;
http::client::CertificateChainFunction m_certificate_chain_callback;

#if !defined(_WIN32) ||
!defined(__cplusplus_winrt) std::function<void(boost::asio::ssl::context&)> m_ssl_context_callback;
#if !defined(_WIN32) || !defined(__cplusplus_winrt)
std::function<void(boost::asio::ssl::context&)> m_ssl_context_callback;
#endif
};

Expand All @@ -252,14 +251,14 @@ class websocket_exception : public std::exception
/// Creates an <c>websocket_exception</c> with just a string message and no error code.
/// </summary>
/// <param name="whatArg">Error message string.</param>
websocket_exception(const utility::string_t& whatArg) : m_msg(utility::conversions::to_utf8string(whatArg)) { }
websocket_exception(const utility::string_t& whatArg) : m_msg(utility::conversions::to_utf8string(whatArg)) {}

#ifdef _WIN32
/// <summary>
/// Creates an <c>websocket_exception</c> with just a string message and no error code.
/// </summary>
/// <param name="whatArg">Error message string.</param>
websocket_exception(std::string whatArg) : m_msg(std::move(whatArg)) { }
websocket_exception(std::string whatArg) : m_msg(std::move(whatArg)) {}
#endif

/// <summary>
Expand Down Expand Up @@ -349,9 +348,9 @@ namespace details
class websocket_client_callback_impl
{
public:
websocket_client_callback_impl(websocket_client_config config) : m_config(std::move(config)) { }
websocket_client_callback_impl(websocket_client_config config) : m_config(std::move(config)) {}

virtual ~websocket_client_callback_impl() CPPREST_NOEXCEPT { }
virtual ~websocket_client_callback_impl() CPPREST_NOEXCEPT {}

virtual pplx::task<void> connect() = 0;

Expand Down Expand Up @@ -443,7 +442,7 @@ class websocket_client
/// <summary>
/// Creates a new websocket_client.
/// </summary>
websocket_client() : m_client(std::make_shared<details::websocket_client_task_impl>(websocket_client_config())) { }
websocket_client() : m_client(std::make_shared<details::websocket_client_task_impl>(websocket_client_config())) {}

/// <summary>
/// Creates a new websocket_client.
Expand All @@ -467,19 +466,17 @@ class websocket_client
m_client->callback_client()->verify_uri(uri);
m_client->callback_client()->set_uri(uri);
auto client = m_client;
return m_client->callback_client()->connect().then(
[client](pplx::task<void> result)
return m_client->callback_client()->connect().then([client](pplx::task<void> result) {
try
{
result.get();
}
catch (const websocket_exception& ex)
{
try
{
result.get();
}
catch (const websocket_exception& ex)
{
client->close_pending_tasks_with_error(ex);
throw;
}
});
client->close_pending_tasks_with_error(ex);
throw;
}
});
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Release/src/http/client/http_client_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class request_context
{
public:
// Destructor to clean up any held resources.
virtual ~request_context() { }
virtual ~request_context() {}

virtual void report_exception(std::exception_ptr exceptionPtr);

Expand Down
Loading

0 comments on commit 32cb396

Please sign in to comment.