Skip to content

Commit e9bd766

Browse files
committed
Move default timeout to netlib namespace
Add some preparations for http addition Add uri-parser as submodule
1 parent e996139 commit e9bd766

File tree

7 files changed

+27
-2
lines changed

7 files changed

+27
-2
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "doctest"]
22
path = doctest
33
url = https://github.com/onqtam/doctest.git
4+
[submodule "extern/cpp-uri-parser"]
5+
path = extern/cpp-uri-parser
6+
url = https://github.com/lpcvoid/cpp-uri-parser

examples/http_client.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//
2+
// Created by lpcvoid on 25.12.22.
3+
//

extern/cpp-uri-parser

Submodule cpp-uri-parser added at b6ff039

src/client.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
namespace netlib {
1414

1515
using namespace std::chrono_literals;
16+
static constexpr std::chrono::milliseconds DEFAULT_TIMEOUT = 1000ms;
1617

1718
class client {
18-
private:
19-
static constexpr std::chrono::milliseconds DEFAULT_TIMEOUT = 1000ms;
2019
protected:
2120
std::optional<netlib::socket> _socket;
2221
addrinfo *_endpoint_addr = nullptr;

src/http/client.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//
2+
// Created by lpcvoid on 25.12.22.
3+
//
4+
5+
#ifndef NETLIB_CLIENT_HPP
6+
#define NETLIB_CLIENT_HPP
7+
8+
#endif // NETLIB_CLIENT_HPP

src/http/http.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//
2+
// Created by lpcvoid on 25.12.22.
3+
//
4+
5+
#ifndef NETLIB_HTTP_HPP
6+
#define NETLIB_HTTP_HPP
7+
8+
#endif // NETLIB_HTTP_HPP

tests/test_http_parser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//
2+
// Created by lpcvoid on 26.12.22.
3+
//

0 commit comments

Comments
 (0)