mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-04 06:46:23 +00:00
Implement Assertion properly, TID printing in debug builds
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
///
|
||||
#define CURL_STATICLIB
|
||||
#include "Curl/curl.h"
|
||||
#include "Assert.h"
|
||||
#include <iostream>
|
||||
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp){
|
||||
((std::string*)userp)->append((char*)contents, size * nmemb);
|
||||
@@ -13,6 +14,7 @@ std::string HttpRequest(const std::string& IP,int port){
|
||||
CURLcode res;
|
||||
std::string readBuffer;
|
||||
curl = curl_easy_init();
|
||||
Assert(curl);
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, IP.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_PORT, port);
|
||||
@@ -30,6 +32,7 @@ std::string PostHTTP(const std::string& IP,const std::string& Fields){
|
||||
CURLcode res;
|
||||
std::string readBuffer;
|
||||
curl = curl_easy_init();
|
||||
Assert(curl);
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, IP.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, Fields.size());
|
||||
@@ -42,4 +45,4 @@ std::string PostHTTP(const std::string& IP,const std::string& Fields){
|
||||
if(res != CURLE_OK)return "-1";
|
||||
}
|
||||
return readBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user