mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-10 09:46:16 +00:00
Replaced cURL with evpp
This commit is contained in:
@@ -6,7 +6,21 @@
|
||||
/// Created by Anonymous275 on 7/18/2020
|
||||
///
|
||||
#pragma once
|
||||
#include <evpp/httpc/response.h>
|
||||
#include <evpp/httpc/request.h>
|
||||
#include <string>
|
||||
int Download(const std::string& URL,const std::string& Path,bool close);
|
||||
std::string PostHTTP(const std::string& IP, const std::string& Fields);
|
||||
std::string HTTP_REQUEST(const std::string& IP,int port);
|
||||
#include "Logger.h"
|
||||
class HTTP{
|
||||
public:
|
||||
static void Response(const std::shared_ptr<evpp::httpc::Response>& response, evpp::httpc::Request* request);
|
||||
static bool Download(const std::string &IP, const std::string &Path);
|
||||
static std::string Post(const std::string& IP, const std::string& Fields);
|
||||
static std::string Get(const std::string &IP);
|
||||
static void Init(char* argv[]){
|
||||
google::InitGoogleLogging(argv[0]);
|
||||
google::SetStderrLogging(google::GLOG_ERROR);
|
||||
evpp::httpc::SET_SSL_VERIFY_MODE(SSL_VERIFY_NONE);
|
||||
}
|
||||
private:
|
||||
static std::string Res_;
|
||||
};
|
||||
24
include/winmain-inl.h
Normal file
24
include/winmain-inl.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
namespace {
|
||||
struct OnApp {
|
||||
OnApp() {
|
||||
#ifdef WIN32
|
||||
// Initialize Winsock 2.2
|
||||
WSADATA wsaData;
|
||||
int err = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
|
||||
if (err) {
|
||||
std::cout << "WSAStartup() failed with error: %d" << err;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
~OnApp() {
|
||||
#ifdef WIN32
|
||||
WSACleanup();
|
||||
#endif
|
||||
}
|
||||
} __s_onexit_pause;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user