Backup:Servers module.
This commit is contained in:
parent
c679ced96c
commit
64ad852f91
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -3,3 +3,7 @@ cmake-shell/
|
|||
external/gtest/googletest-release-1.11.0/
|
||||
external/libconfig/libconfig-1.7.3/
|
||||
output_files/
|
||||
external/openssl/openssl-1.1.1s/
|
||||
external/openssl/openssl-3.1.0/
|
||||
external/openssl/build/
|
||||
external/curl/curl-8.1.2/
|
|
@ -44,19 +44,19 @@ TEST(ServersTest, FtpsUpload)
|
|||
const char *url = "ftp://150.109.112.64/ServersTest";test/bin/ServersTest";
|
||||
const char *uploadFile = "./ServersTest";
|
||||
const char *user_password = "ftp_user:Sifar%123456";
|
||||
SERVERS_INIT init = {
|
||||
ServerInit init = {
|
||||
.logFlag = LOG_FLAG_ENABLE, // 开启curl日志
|
||||
.sslVerifyFlag = SSL_VERIFY_DISABLE, //关闭ssl的证书校验功能
|
||||
};
|
||||
InitLog(LOG_EASYLOGGING, nullptr); // 初始化自研log库
|
||||
servers_init(init); // 初始化Servers模块
|
||||
ServersInit(init); // 初始化Servers模块
|
||||
LogInfo("servers test start.\n");
|
||||
SERVERS_FTP *ftp = new_servers_ftp(url, FTPS_FLAG_ENABLE); // 创建ftp的参数“句柄”
|
||||
ServerFtp *ftp = NewServersFtp(url, FTPS_FLAG_ENABLE); // 创建ftp的参数“句柄”
|
||||
if (ftp)
|
||||
{
|
||||
ftp->user_password = (char *)user_password;
|
||||
ftp->filePath = (char *)uploadFile;
|
||||
ftp_upload(ftp); // 使用FTP上传文件
|
||||
FtpUpload(ftp); // 使用FTP上传文件
|
||||
if (SERVERS_CODE_OK == ftp->code)
|
||||
{
|
||||
LogInfo("ftp succeed.\n");
|
||||
|
@ -65,7 +65,7 @@ TEST(ServersTest, FtpsUpload)
|
|||
{
|
||||
LogError("ftp failed, code = %d.\n", static_cast<int>(ftp->code));
|
||||
}
|
||||
delete_servers_ftp(ftp); // 释放ftp“句柄”
|
||||
DeleteServersFtp(ftp); // 释放ftp“句柄”
|
||||
}
|
||||
UnInitLog();
|
||||
}
|
||||
|
|
|
@ -43,11 +43,11 @@ typedef enum
|
|||
SSL_VERIFY_DISABLE,
|
||||
SSL_VERIFY_END
|
||||
} SslFlag;
|
||||
typedef struct servers_init
|
||||
typedef struct ServersInit
|
||||
{
|
||||
LogFlag logFlag;
|
||||
SslFlag sslVerifyFlag;
|
||||
} SERVERS_INIT;
|
||||
} ServerInit;
|
||||
typedef struct servers_http
|
||||
{
|
||||
const char *url;
|
||||
|
@ -57,7 +57,7 @@ typedef struct servers_http
|
|||
char *reply;
|
||||
unsigned int replyLength;
|
||||
int code;
|
||||
} SERVERS_HTTP;
|
||||
} ServerHttp;
|
||||
typedef struct servers_ftp
|
||||
{
|
||||
const char *url;
|
||||
|
@ -66,7 +66,7 @@ typedef struct servers_ftp
|
|||
char *filePath;
|
||||
unsigned int timeOutMs;
|
||||
int code;
|
||||
} SERVERS_FTP;
|
||||
} ServerFtp;
|
||||
typedef struct servers_smtp
|
||||
{
|
||||
const char *url;
|
||||
|
@ -83,26 +83,26 @@ typedef struct servers_smtp
|
|||
// unsigned int textLength;
|
||||
char **attachment;
|
||||
int code;
|
||||
} SERVERS_SMTP;
|
||||
void servers_init(SERVERS_INIT init);
|
||||
void servers_unit(void);
|
||||
} ServerSmtp;
|
||||
void ServersInit(ServerInit init);
|
||||
void ServersUnInit(void);
|
||||
// HTTP API
|
||||
SERVERS_HTTP *new_servers_http(const char *url);
|
||||
void delete_servers_http(SERVERS_HTTP *ptr);
|
||||
void http_get(SERVERS_HTTP *param);
|
||||
void http_post(SERVERS_HTTP *param);
|
||||
void http_put(SERVERS_HTTP *param);
|
||||
ServerHttp *NewServersHttp(const char *url);
|
||||
void DeleteServersHttp(ServerHttp *ptr);
|
||||
void HttpGet(ServerHttp *param);
|
||||
void HttpPost(ServerHttp *param);
|
||||
void HttpPut(ServerHttp *param);
|
||||
// FTP API
|
||||
SERVERS_FTP *new_servers_ftp(const char *url, const FtpsFlag ftpsFlag);
|
||||
void delete_servers_ftp(SERVERS_FTP *ptr);
|
||||
void ftp_servers_check(SERVERS_FTP *param);
|
||||
void ftp_download(SERVERS_FTP *param);
|
||||
void ftp_upload(SERVERS_FTP *param);
|
||||
ServerFtp *NewServersFtp(const char *url, const FtpsFlag ftpsFlag);
|
||||
void DeleteServersFtp(ServerFtp *ptr);
|
||||
void FtpServersCheck(ServerFtp *param);
|
||||
void FtpDownload(ServerFtp *param);
|
||||
void FtpUpload(ServerFtp *param);
|
||||
// SMTP API
|
||||
SERVERS_SMTP *new_servers_smtp(const char *url, const char *subject, const char *from, const char *to,
|
||||
ServerSmtp *new_servers_smtp(const char *url, const char *subject, const char *from, const char *to,
|
||||
const char *userName, const char *password, const char *date);
|
||||
void delete_servers_smtp(SERVERS_SMTP *ptr);
|
||||
void smtp_send_email(SERVERS_SMTP *param);
|
||||
void delete_servers_smtp(ServerSmtp *ptr);
|
||||
void smtp_send_email(ServerSmtp *param);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
#include "curl_serve.h"
|
||||
static SERVERS_INIT gCurlServe;
|
||||
void set_verbose_log(LogFlag flag) { gCurlServe.logFlag = flag; }
|
||||
void set_ssl_verify(SslFlag flag) { gCurlServe.sslVerifyFlag = flag; }
|
||||
CURL *curl_easy_make(void)
|
||||
static ServerInit gCurlServe;
|
||||
void SetVerboseLog(LogFlag flag) { gCurlServe.logFlag = flag; }
|
||||
void SetSslVerify(SslFlag flag) { gCurlServe.sslVerifyFlag = flag; }
|
||||
CURL *CurlEasyMake(void)
|
||||
{
|
||||
CURL *curl;
|
||||
curl = curl_easy_init();
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void set_verbose_log(LogFlag flag);
|
||||
void set_ssl_verify(SslFlag flag);
|
||||
CURL *curl_easy_make(void);
|
||||
void SetVerboseLog(LogFlag flag);
|
||||
void SetSslVerify(SslFlag flag);
|
||||
CURL *CurlEasyMake(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -36,10 +36,10 @@ static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream)
|
|||
}
|
||||
return fwrite(buffer, size, nmemb, out->stream);
|
||||
}
|
||||
static CURL *ftp_curl_easy_make(SERVERS_FTP *param)
|
||||
static CURL *ftp_curl_easy_make(ServerFtp *param)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
curl = curl_easy_make();
|
||||
curl = CurlEasyMake();
|
||||
if (curl) {
|
||||
/*
|
||||
* You better replace the URL with one that works!
|
||||
|
@ -59,7 +59,7 @@ static CURL *ftp_curl_easy_make(SERVERS_FTP *param)
|
|||
}
|
||||
return curl;
|
||||
}
|
||||
void ftp_servers_check_connect(SERVERS_FTP *param)
|
||||
void FtpServersCheckConnect(ServerFtp *param)
|
||||
{
|
||||
if (!param) {
|
||||
LogError("null pointer.\n");
|
||||
|
@ -87,7 +87,7 @@ void ftp_servers_check_connect(SERVERS_FTP *param)
|
|||
|
||||
curl_global_cleanup();
|
||||
}
|
||||
void ftp_servers_download(SERVERS_FTP *param)
|
||||
void FtpServersDownload(ServerFtp *param)
|
||||
{
|
||||
if (!param) {
|
||||
LogError("null pointer.\n");
|
||||
|
@ -143,7 +143,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream)
|
|||
|
||||
return retcode;
|
||||
}
|
||||
void ftp_servers_upload(SERVERS_FTP *param)
|
||||
void FtpServersUpload(ServerFtp *param)
|
||||
{
|
||||
if (!param) {
|
||||
LogError("null pointer.\n");
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void ftp_servers_check_connect(SERVERS_FTP *param);
|
||||
void ftp_servers_download(SERVERS_FTP *param);
|
||||
void ftp_servers_upload(SERVERS_FTP *param);
|
||||
void FtpServersCheckConnect(ServerFtp *param);
|
||||
void FtpServersDownload(ServerFtp *param);
|
||||
void FtpServersUpload(ServerFtp *param);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -27,7 +27,7 @@ static size_t write_cb(char *data, size_t n, size_t l, void *userp)
|
|||
/* take care of the data here, ignored in this example */
|
||||
(void)data;
|
||||
(void)userp;
|
||||
SERVERS_HTTP *p = (SERVERS_HTTP *)userp;
|
||||
ServerHttp *p = (ServerHttp *)userp;
|
||||
const int LENGTH = n * l;
|
||||
// p->reply = (char *)realloc(p->reply, LENGTH);
|
||||
char *newData = (char *)malloc(p->replyLength + LENGTH);
|
||||
|
@ -43,7 +43,7 @@ static size_t write_cb(char *data, size_t n, size_t l, void *userp)
|
|||
}
|
||||
return n * l;
|
||||
}
|
||||
void http_servers_get(SERVERS_HTTP *param)
|
||||
void HttpServersGet(ServerHttp *param)
|
||||
{
|
||||
if (!param) {
|
||||
LogError("null pointer.\n");
|
||||
|
@ -52,7 +52,7 @@ void http_servers_get(SERVERS_HTTP *param)
|
|||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
||||
curl = curl_easy_make();
|
||||
curl = CurlEasyMake();
|
||||
if (curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, param->url);
|
||||
/* example.com is redirected, so we tell libcurl to follow redirection */
|
||||
|
@ -72,7 +72,7 @@ void http_servers_get(SERVERS_HTTP *param)
|
|||
curl_easy_cleanup(curl);
|
||||
}
|
||||
}
|
||||
void http_servers_post(SERVERS_HTTP *param)
|
||||
void HttpServersPost(ServerHttp *param)
|
||||
{
|
||||
if (!param) {
|
||||
LogError("null pointer.\n");
|
||||
|
@ -85,7 +85,7 @@ void http_servers_post(SERVERS_HTTP *param)
|
|||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
/* get a curl handle */
|
||||
curl = curl_easy_make();
|
||||
curl = CurlEasyMake();
|
||||
if (curl) {
|
||||
/* First set the URL that is about to receive our POST. This URL can
|
||||
just as well be an https:// URL if that is what should receive the
|
||||
|
@ -140,7 +140,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream)
|
|||
|
||||
return retcode;
|
||||
}
|
||||
void http_servers_put(SERVERS_HTTP *param)
|
||||
void HttpServersPut(ServerHttp *param)
|
||||
{
|
||||
if (!param) {
|
||||
LogError("null pointer.\n");
|
||||
|
@ -176,7 +176,7 @@ void http_servers_put(SERVERS_HTTP *param)
|
|||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
/* get a curl handle */
|
||||
curl = curl_easy_make();
|
||||
curl = CurlEasyMake();
|
||||
if (curl) {
|
||||
/* we want to use our own read function */
|
||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void http_servers_get(SERVERS_HTTP *param);
|
||||
void http_servers_post(SERVERS_HTTP *param);
|
||||
void http_servers_put(SERVERS_HTTP *param);
|
||||
void HttpServersGet(ServerHttp *param);
|
||||
void HttpServersPost(ServerHttp *param);
|
||||
void HttpServersPut(ServerHttp *param);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -21,50 +21,50 @@
|
|||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
void servers_init(SERVERS_INIT init)
|
||||
void ServersInit(ServerInit init)
|
||||
{
|
||||
set_verbose_log(init.logFlag);
|
||||
set_ssl_verify(init.sslVerifyFlag);
|
||||
SetVerboseLog(init.logFlag);
|
||||
SetSslVerify(init.sslVerifyFlag);
|
||||
}
|
||||
void servers_unit(void) {}
|
||||
void http_get(SERVERS_HTTP *param)
|
||||
void ServersUnInit(void) {}
|
||||
void HttpGet(ServerHttp *param)
|
||||
{
|
||||
LogInfo("http_get\n");
|
||||
http_servers_get(param);
|
||||
LogInfo("HttpGet\n");
|
||||
HttpServersGet(param);
|
||||
}
|
||||
void http_post(SERVERS_HTTP *param)
|
||||
void HttpPost(ServerHttp *param)
|
||||
{
|
||||
LogInfo("http_post\n");
|
||||
http_servers_post(param);
|
||||
LogInfo("HttpPost\n");
|
||||
HttpServersPost(param);
|
||||
}
|
||||
void http_put(SERVERS_HTTP *param)
|
||||
void HttpPut(ServerHttp *param)
|
||||
{
|
||||
LogInfo("http_put\n");
|
||||
http_servers_put(param);
|
||||
LogInfo("HttpPut\n");
|
||||
HttpServersPut(param);
|
||||
}
|
||||
void smtp_send_email(SERVERS_SMTP *param)
|
||||
void smtp_send_email(ServerSmtp *param)
|
||||
{
|
||||
LogInfo("smtp_send_email\n");
|
||||
smtp_servers_send_email(param);
|
||||
// smtp_servers_send_email_only_text(param);
|
||||
SmtpServersSendEmail(param);
|
||||
// SmtpServersSendEmailOnlyText(param);
|
||||
}
|
||||
SERVERS_HTTP *new_servers_http(const char *url)
|
||||
ServerHttp *NewServersHttp(const char *url)
|
||||
{
|
||||
if (!url) {
|
||||
LogError("new_servers_http failed.\n");
|
||||
LogError("NewServersHttp failed.\n");
|
||||
return NULL;
|
||||
}
|
||||
SERVERS_HTTP result = {
|
||||
ServerHttp result = {
|
||||
.url = url, .postData = NULL, .filePath = NULL, .header = NULL, .reply = NULL, .replyLength = 0, .code = 0};
|
||||
const int LENGTH = sizeof(SERVERS_HTTP);
|
||||
SERVERS_HTTP *p = (SERVERS_HTTP *)malloc(LENGTH);
|
||||
const int LENGTH = sizeof(ServerHttp);
|
||||
ServerHttp *p = (ServerHttp *)malloc(LENGTH);
|
||||
if (p) {
|
||||
LogInfo("malloc succeed.\n");
|
||||
memcpy(p, &result, LENGTH);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
void delete_servers_http(SERVERS_HTTP *ptr)
|
||||
void DeleteServersHttp(ServerHttp *ptr)
|
||||
{
|
||||
if (ptr) {
|
||||
if (ptr->reply) {
|
||||
|
@ -74,51 +74,51 @@ void delete_servers_http(SERVERS_HTTP *ptr)
|
|||
free(ptr);
|
||||
}
|
||||
}
|
||||
SERVERS_FTP *new_servers_ftp(const char *url, const FtpsFlag ftpsFlag)
|
||||
ServerFtp *NewServersFtp(const char *url, const FtpsFlag ftpsFlag)
|
||||
{
|
||||
if (!url) {
|
||||
LogError("new_servers_ftp failed.\n");
|
||||
LogError("NewServersFtp failed.\n");
|
||||
return NULL;
|
||||
}
|
||||
SERVERS_FTP result = {.url = url,
|
||||
ServerFtp result = {.url = url,
|
||||
.ftpsFlag = ftpsFlag,
|
||||
.user_password = NULL,
|
||||
.filePath = NULL,
|
||||
.timeOutMs = SERVERS_NEVER_TIMEOUT,
|
||||
.code = -1};
|
||||
const int LENGTH = sizeof(SERVERS_FTP);
|
||||
SERVERS_FTP *p = (SERVERS_FTP *)malloc(LENGTH);
|
||||
const int LENGTH = sizeof(ServerFtp);
|
||||
ServerFtp *p = (ServerFtp *)malloc(LENGTH);
|
||||
if (p) {
|
||||
LogInfo("malloc succeed.\n");
|
||||
memcpy(p, &result, LENGTH);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
void delete_servers_ftp(SERVERS_FTP *ptr)
|
||||
void DeleteServersFtp(ServerFtp *ptr)
|
||||
{
|
||||
if (ptr) {
|
||||
free(ptr);
|
||||
}
|
||||
}
|
||||
void ftp_servers_check(SERVERS_FTP *param) { ftp_servers_check_connect(param); }
|
||||
void ftp_download(SERVERS_FTP *param)
|
||||
void FtpServersCheck(ServerFtp *param) { FtpServersCheckConnect(param); }
|
||||
void FtpDownload(ServerFtp *param)
|
||||
{
|
||||
LogInfo("ftp_download\n");
|
||||
ftp_servers_download(param);
|
||||
LogInfo("FtpDownload\n");
|
||||
FtpServersDownload(param);
|
||||
}
|
||||
void ftp_upload(SERVERS_FTP *param)
|
||||
void FtpUpload(ServerFtp *param)
|
||||
{
|
||||
LogInfo("ftp_upload\n");
|
||||
ftp_servers_upload(param);
|
||||
LogInfo("FtpUpload\n");
|
||||
FtpServersUpload(param);
|
||||
}
|
||||
SERVERS_SMTP *new_servers_smtp(const char *url, const char *subject, const char *from, const char *to,
|
||||
ServerSmtp *new_servers_smtp(const char *url, const char *subject, const char *from, const char *to,
|
||||
const char *userName, const char *password, const char *date)
|
||||
{
|
||||
if (!url || !from || !to || !userName || !password || !subject || !date) {
|
||||
LogError("new_servers_smtp failed.\n");
|
||||
return NULL;
|
||||
}
|
||||
SERVERS_SMTP result = {.url = url,
|
||||
ServerSmtp result = {.url = url,
|
||||
.subject = subject,
|
||||
.from = from,
|
||||
.to = to,
|
||||
|
@ -130,15 +130,15 @@ SERVERS_SMTP *new_servers_smtp(const char *url, const char *subject, const char
|
|||
// .textLength = 0,
|
||||
.attachment = NULL,
|
||||
.code = -1};
|
||||
const int LENGTH = sizeof(SERVERS_SMTP);
|
||||
SERVERS_SMTP *p = (SERVERS_SMTP *)malloc(LENGTH);
|
||||
const int LENGTH = sizeof(ServerSmtp);
|
||||
ServerSmtp *p = (ServerSmtp *)malloc(LENGTH);
|
||||
if (p) {
|
||||
LogInfo("malloc succeed.\n");
|
||||
memcpy(p, &result, LENGTH);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
void delete_servers_smtp(SERVERS_SMTP *ptr)
|
||||
void delete_servers_smtp(ServerSmtp *ptr)
|
||||
{
|
||||
if (ptr) {
|
||||
free(ptr);
|
||||
|
|
|
@ -72,7 +72,7 @@ enum HEADERS_NAME
|
|||
HEADERS_NAME_SUBJECT,
|
||||
HEADERS_NAME_END
|
||||
};
|
||||
static void headers_make(char **headers, SERVERS_SMTP *param)
|
||||
static void headers_make(char **headers, ServerSmtp *param)
|
||||
{
|
||||
int textLength = strlen(DATE) + strlen(param->date) + 1;
|
||||
char *text = (char *)malloc(textLength);
|
||||
|
@ -118,7 +118,7 @@ static void headers_free(char **headers)
|
|||
cpp++;
|
||||
}
|
||||
}
|
||||
void smtp_servers_send_email(SERVERS_SMTP *param)
|
||||
void SmtpServersSendEmail(ServerSmtp *param)
|
||||
{
|
||||
if (!param) {
|
||||
LogError("null pointer.\n");
|
||||
|
@ -129,7 +129,7 @@ void smtp_servers_send_email(SERVERS_SMTP *param)
|
|||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
curl = curl_easy_make();
|
||||
curl = CurlEasyMake();
|
||||
if (curl) {
|
||||
struct curl_slist *headers = NULL;
|
||||
struct curl_slist *recipients = NULL;
|
||||
|
@ -231,7 +231,7 @@ void smtp_servers_send_email(SERVERS_SMTP *param)
|
|||
headers_free(headers_text);
|
||||
}
|
||||
}
|
||||
void smtp_servers_send_email_only_text(SERVERS_SMTP *param)
|
||||
void SmtpServersSendEmailOnlyText(ServerSmtp *param)
|
||||
{
|
||||
#if 0 // only for test.
|
||||
if (!param)
|
||||
|
@ -269,7 +269,7 @@ void smtp_servers_send_email_only_text(SERVERS_SMTP *param)
|
|||
struct upload_status upload_ctx = {0};
|
||||
upload_ctx.payload_text = payload_text;
|
||||
|
||||
curl = curl_easy_make();
|
||||
curl = CurlEasyMake();
|
||||
if (curl)
|
||||
{
|
||||
curl_mime *mime;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void smtp_servers_send_email(SERVERS_SMTP *param);
|
||||
void smtp_servers_send_email_only_text(SERVERS_SMTP *param);
|
||||
void SmtpServersSendEmail(ServerSmtp *param);
|
||||
void SmtpServersSendEmailOnlyText(ServerSmtp *param);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -4,15 +4,15 @@ void test0()
|
|||
{
|
||||
// InitLog(LOG_EASYLOGGING, NULL);
|
||||
// LogInfo("servers test start.\n");
|
||||
SERVERS_HTTP *http = new_servers_http("http://example.com");
|
||||
ServerHttp *http = NewServersHttp("http://example.com");
|
||||
if (http)
|
||||
{
|
||||
http_get(http);
|
||||
HttpGet(http);
|
||||
if (http->reply)
|
||||
{
|
||||
// LogInfo("HttpGet ========\n %s\n", http->reply);
|
||||
}
|
||||
delete_servers_http(http);
|
||||
DeleteServersHttp(http);
|
||||
}
|
||||
// UnInitLog();
|
||||
}
|
||||
|
@ -20,15 +20,15 @@ void test1()
|
|||
{
|
||||
// InitLog(LOG_EASYLOGGING, NULL);
|
||||
// LogInfo("servers test start.\n");
|
||||
// SERVERS_HTTP *http = new_servers_http("https://example.com");
|
||||
// ServerHttp *http = NewServersHttp("https://example.com");
|
||||
// if (http)
|
||||
// {
|
||||
// http_get(http);
|
||||
// HttpGet(http);
|
||||
// if (http->reply)
|
||||
// {
|
||||
// LogInfo("HttpGet ========\n %s\n", http->reply);
|
||||
// }
|
||||
// delete_servers_http(http);
|
||||
// DeleteServersHttp(http);
|
||||
// }
|
||||
// UnInitLog();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user