style: clang-format pass
This commit is contained in:
+16
-15
@@ -5,22 +5,23 @@
|
||||
#include <mutex>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
class CertManager {
|
||||
public:
|
||||
CertManager();
|
||||
~CertManager();
|
||||
class CertManager
|
||||
{
|
||||
public:
|
||||
CertManager();
|
||||
~CertManager();
|
||||
|
||||
bool Init();
|
||||
SSL_CTX* CreateHostContext(const std::string& host);
|
||||
bool Init();
|
||||
SSL_CTX* CreateHostContext(const std::string& host);
|
||||
|
||||
private:
|
||||
bool GenerateCA();
|
||||
bool LoadCA();
|
||||
private:
|
||||
bool GenerateCA();
|
||||
bool LoadCA();
|
||||
|
||||
EVP_PKEY* _caPkey = nullptr;
|
||||
X509* _caCert = nullptr;
|
||||
EVP_PKEY* _sessionPkey = nullptr;
|
||||
|
||||
std::mutex _mutex;
|
||||
std::unordered_map<std::string, SSL_CTX*> _hostContexts;
|
||||
EVP_PKEY* _caPkey = nullptr;
|
||||
X509* _caCert = nullptr;
|
||||
EVP_PKEY* _sessionPkey = nullptr;
|
||||
|
||||
std::mutex _mutex;
|
||||
std::unordered_map<std::string, SSL_CTX*> _hostContexts;
|
||||
};
|
||||
|
||||
@@ -399,7 +399,8 @@ int main()
|
||||
{
|
||||
std::string objStr = currentItems.substr(objStart, objEnd - objStart + 1);
|
||||
if (std::regex_search(objStr, qtyRegex))
|
||||
objStr = std::regex_replace(objStr, qtyRegex, "\"quantity\":" + std::to_string(qty));
|
||||
objStr =
|
||||
std::regex_replace(objStr, qtyRegex, "\"quantity\":" + std::to_string(qty));
|
||||
else
|
||||
objStr.insert(objStr.length() - 1, ",\"quantity\":" + std::to_string(qty));
|
||||
|
||||
@@ -419,7 +420,8 @@ int main()
|
||||
if (seenIds.find(id) == seenIds.end())
|
||||
{
|
||||
if (!currentItems.empty() && currentItems.back() != ',') currentItems += ",";
|
||||
currentItems += "{\"itemId\":\"" + id + "\",\"quantity\":" + std::to_string(qty) + "}";
|
||||
currentItems +=
|
||||
"{\"itemId\":\"" + id + "\",\"quantity\":" + std::to_string(qty) + "}";
|
||||
seenIds.insert(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,4 +549,4 @@ void Proxy::handleClient(SOCKET hClientSocket)
|
||||
if (connectionClosed) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
TO-DO:
|
||||
use random port, test availability
|
||||
*/
|
||||
#define PROXY_PORT 58421
|
||||
#define PROXY_PORT 58421
|
||||
|
||||
typedef unsigned __int64 SOCKET;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user