clang-format everything

This commit is contained in:
Lion Kortlepel
2020-11-12 17:09:14 +01:00
parent c9f5ee9729
commit 58e65cf43f
29 changed files with 716 additions and 677 deletions

View File

@@ -2,38 +2,39 @@
/// Created by Anonymous275 on 4/9/2020
///
#include <curl/curl.h>
#include "CustomAssert.h"
#include <curl/curl.h>
#include <iostream>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp){
static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp) {
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
std::string HttpRequest(const std::string& IP,int port){
CURL *curl;
std::string HttpRequest(const std::string& IP, int port) {
CURL* curl;
CURLcode res;
std::string readBuffer;
curl = curl_easy_init();
Assert(curl);
if(curl) {
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, IP.c_str());
curl_easy_setopt(curl, CURLOPT_PORT, port);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if(res != CURLE_OK)return "-1";
if (res != CURLE_OK)
return "-1";
}
return readBuffer;
}
std::string PostHTTP(const std::string& IP,const std::string& Fields){
CURL *curl;
std::string PostHTTP(const std::string& IP, const std::string& Fields) {
CURL* curl;
CURLcode res;
std::string readBuffer;
curl = curl_easy_init();
Assert(curl);
if(curl) {
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, IP.c_str());
/*curl_easy_setopt(curl, CURLOPT_URL, "https://95.216.35.232/heartbeatv2");
curl_easy_setopt(curl, CURLOPT_PORT, 3600);*/
@@ -44,7 +45,8 @@ std::string PostHTTP(const std::string& IP,const std::string& Fields){
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if(res != CURLE_OK)return "-1";
if (res != CURLE_OK)
return "-1";
}
return readBuffer;
}