mirror of
https://github.com//cppla/ServerStatus
synced 2025-07-03 16:05:59 +08:00
link libcurl static lib
This commit is contained in:
parent
f70705d872
commit
2e62ffa593
@ -3,7 +3,7 @@ FROM debian:buster as builder
|
|||||||
|
|
||||||
MAINTAINER cppla https://cpp.la
|
MAINTAINER cppla https://cpp.la
|
||||||
|
|
||||||
RUN apt-get update -y && apt-get -y install gcc g++ make
|
RUN apt-get update -y && apt-get -y install gcc g++ make libcurl4-openssl-dev
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ $(ODIR)/%.o: $(SDIR)/%.cpp
|
|||||||
$(CXX) -c $(INC) $(CXXFLAGS) $< -o $@
|
$(CXX) -c $(INC) $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OUT): $(OBJS)
|
$(OUT): $(OBJS)
|
||||||
$(CXX) $(LIBS) $^ -o $(OUT)
|
$(CXX) $(LIBS) $^ -o $(OUT) -lcurl
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "exprtk.hpp"
|
#include "exprtk.hpp"
|
||||||
|
#include "curl/curl.h"
|
||||||
|
|
||||||
#if defined(CONF_FAMILY_UNIX)
|
#if defined(CONF_FAMILY_UNIX)
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -321,6 +322,22 @@ void CMain::WatchdogMessage(int ClientNetID, double load_1, double load_5, doubl
|
|||||||
printf("node info: %s\n\n", Client(ClientID)->m_aLocation);
|
printf("node info: %s\n\n", Client(ClientID)->m_aLocation);
|
||||||
printf("watchdog name: %s\n", Watchdog(ID)->m_aName);
|
printf("watchdog name: %s\n", Watchdog(ID)->m_aName);
|
||||||
printf("watchdog rule: %s\n", Watchdog(ID)->m_aRule);
|
printf("watchdog rule: %s\n", Watchdog(ID)->m_aRule);
|
||||||
|
CURL *curl;
|
||||||
|
CURLcode res;
|
||||||
|
|
||||||
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
|
||||||
|
curl = curl_easy_init();
|
||||||
|
if(curl) {
|
||||||
|
curl_easy_setopt(curl, CURLOPT_URL, "https://cpp.la");
|
||||||
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "name=daniel&project=curl");
|
||||||
|
res = curl_easy_perform(curl);
|
||||||
|
if(res != CURLE_OK)
|
||||||
|
fprintf(stderr, "curl_easy_perform() failed: %s\n",
|
||||||
|
curl_easy_strerror(res));
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
|
}
|
||||||
|
curl_global_cleanup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ID++;
|
ID++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user