Skip to content

Commit

Permalink
httplib: set_timeout_sec() deprecated
Browse files Browse the repository at this point in the history
in the 3rd party lib, so avoid using it.
  • Loading branch information
breznak committed Sep 8, 2020
1 parent 8d3f815 commit 606cb75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/examples/rest/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int main(int argc, char **argv) {

VERBOSE << "Connecting to server: " + serverHost + " port: " << port << std::endl;
httplib::Client client(serverHost.c_str(), port);
client.set_timeout_sec(30); // The time it waits for a network connection.
//client.set_timeout_sec(30); // The time it waits for a network connection.

// request "Hello World" to see if we are able to connect to the server.
VERBOSE << "GET /hi" << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions src/test/unit/engine/RESTapiTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class RESTapiTest : public ::testing::Test {
serverThreadObj = std::thread (&RESTapiTest::serverThread, this); // start REST server
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // yield to give server time to start
client.reset(new httplib::Client(host, port));
client->set_timeout_sec(30);
//client->set_timeout_sec(30);
}

virtual void TearDown() {
Expand All @@ -144,7 +144,7 @@ class RESTapiTest : public ::testing::Test {
TEST_F(RESTapiTest, helloWorld) {
// Client thread.
Value vm;
client->set_timeout_sec(30);
//client->set_timeout_sec(30);

// request "Hello World" to see if we are able to connect to the server.
auto res = client->Get("/hi");
Expand All @@ -164,7 +164,7 @@ TEST_F(RESTapiTest, example) {
char message[1000];
Value vm;

client->set_timeout_sec(30);
//client->set_timeout_sec(30);

// Configure a NetworkAPI example
// See Network.configure() for syntax.
Expand Down

0 comments on commit 606cb75

Please sign in to comment.