Minor changes
This commit is contained in:
parent
b1a91fb923
commit
c12e026e0e
1 changed files with 7 additions and 7 deletions
|
|
@ -111,8 +111,8 @@ namespace SimpleWeb {
|
||||||
|
|
||||||
boost::asio::async_read(*socket, *read_buffer,
|
boost::asio::async_read(*socket, *read_buffer,
|
||||||
boost::asio::transfer_exactly(stoull(request->header["Content-Length"])-num_additional_bytes),
|
boost::asio::transfer_exactly(stoull(request->header["Content-Length"])-num_additional_bytes),
|
||||||
[this, socket, read_buffer, request, timer](const boost::system::error_code& ec,
|
[this, socket, read_buffer, request, timer]
|
||||||
size_t bytes_transferred) {
|
(const boost::system::error_code& ec, size_t bytes_transferred) {
|
||||||
timer->cancel();
|
timer->cancel();
|
||||||
if(!ec) {
|
if(!ec) {
|
||||||
//Store pointer to read_buffer as istream object
|
//Store pointer to read_buffer as istream object
|
||||||
|
|
@ -180,8 +180,8 @@ namespace SimpleWeb {
|
||||||
|
|
||||||
//Capture write_buffer in lambda so it is not destroyed before async_write is finished
|
//Capture write_buffer in lambda so it is not destroyed before async_write is finished
|
||||||
boost::asio::async_write(*socket, *write_buffer,
|
boost::asio::async_write(*socket, *write_buffer,
|
||||||
[this, socket, request, write_buffer, timer](const boost::system::error_code& ec,
|
[this, socket, request, write_buffer, timer]
|
||||||
size_t bytes_transferred) {
|
(const boost::system::error_code& ec, size_t bytes_transferred) {
|
||||||
timer->cancel();
|
timer->cancel();
|
||||||
//HTTP persistent connection (HTTP 1.1):
|
//HTTP persistent connection (HTTP 1.1):
|
||||||
if(!ec && stof(request->http_version)>1.05)
|
if(!ec && stof(request->http_version)>1.05)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue