Further cleanup of examples
This commit is contained in:
parent
850dcd6601
commit
0a72f6f280
2 changed files with 2 additions and 4 deletions
|
|
@ -127,8 +127,7 @@ int main() {
|
||||||
server.resource["^/work$"]["GET"]=[](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> /*request*/) {
|
server.resource["^/work$"]["GET"]=[](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> /*request*/) {
|
||||||
thread work_thread([response] {
|
thread work_thread([response] {
|
||||||
this_thread::sleep_for(chrono::seconds(5));
|
this_thread::sleep_for(chrono::seconds(5));
|
||||||
string message="Work done";
|
response->write("Work done");
|
||||||
*response << "HTTP/1.1 200 OK\r\nContent-Length: " << message.length() << "\r\n\r\n" << message;
|
|
||||||
});
|
});
|
||||||
work_thread.detach();
|
work_thread.detach();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -125,8 +125,7 @@ int main() {
|
||||||
server.resource["^/work$"]["GET"]=[](shared_ptr<HttpsServer::Response> response, shared_ptr<HttpsServer::Request> /*request*/) {
|
server.resource["^/work$"]["GET"]=[](shared_ptr<HttpsServer::Response> response, shared_ptr<HttpsServer::Request> /*request*/) {
|
||||||
thread work_thread([response] {
|
thread work_thread([response] {
|
||||||
this_thread::sleep_for(chrono::seconds(5));
|
this_thread::sleep_for(chrono::seconds(5));
|
||||||
string message="Work done";
|
response->write("Work done");
|
||||||
*response << "HTTP/1.1 200 OK\r\nContent-Length: " << message.length() << "\r\n\r\n" << message;
|
|
||||||
});
|
});
|
||||||
work_thread.detach();
|
work_thread.detach();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue