mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2025-08-18 08:35:35 +00:00
try once more
This commit is contained in:
parent
2571cb1478
commit
4e1d2a7ddd
@ -10,25 +10,27 @@
|
||||
#include <curl/curl.h>
|
||||
#include <iostream>
|
||||
|
||||
class CurlManager{
|
||||
class CurlManager {
|
||||
public:
|
||||
CurlManager(){
|
||||
CurlManager() {
|
||||
curl = curl_easy_init();
|
||||
}
|
||||
~CurlManager(){
|
||||
~CurlManager() {
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
inline CURL* Get(){
|
||||
inline CURL* Get() {
|
||||
return curl;
|
||||
}
|
||||
|
||||
private:
|
||||
CURL *curl;
|
||||
CURL* curl;
|
||||
};
|
||||
|
||||
static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp) {
|
||||
((std::string*)userp)->append((char*)contents, size * nmemb);
|
||||
std::string((char*)userp).append((char*)contents, size * nmemb);
|
||||
return size * nmemb;
|
||||
}
|
||||
|
||||
std::string HttpRequest(const std::string& IP, int port) {
|
||||
CurlManager M;
|
||||
std::string readBuffer;
|
||||
@ -55,7 +57,7 @@ std::string PostHTTP(const std::string& IP, const std::string& Fields, bool json
|
||||
CURL* curl = M.Get();
|
||||
CURLcode res;
|
||||
char readBuffer[5000];
|
||||
|
||||
|
||||
Assert(curl);
|
||||
if (curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, IP.c_str());
|
||||
|
Loading…
x
Reference in New Issue
Block a user