mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-29 16:09:10 +00:00
Fixed #28. (Keep-Alive connection support)
This commit is contained in:
parent
ca7b942196
commit
23c8f0c738
4 changed files with 263 additions and 122 deletions
|
@ -67,7 +67,7 @@ string log(const Request& req, const Response& res)
|
|||
|
||||
s += "================================\n";
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s %s", req.method.c_str(), req.path.c_str());
|
||||
snprintf(buf, sizeof(buf), "%s %s %s", req.method.c_str(), req.path.c_str(), req.version.c_str());
|
||||
s += buf;
|
||||
|
||||
string query;
|
||||
|
@ -99,10 +99,12 @@ int main(int argc, const char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto version = httplib::HttpVersion::v1_1;
|
||||
|
||||
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
|
||||
SSLServer svr(SERVER_CERT_FILE, SERVER_PRIVATE_KEY_FILE);
|
||||
SSLServer svr(SERVER_CERT_FILE, SERVER_PRIVATE_KEY_FILE, version);
|
||||
#else
|
||||
Server svr;
|
||||
Server svr(version);
|
||||
#endif
|
||||
|
||||
svr.post("/multipart", [](const auto& req, auto& res) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue