Skip to content

Commit 78fd641

Browse files
committed
Bugfix: fileserver example chunked data
`boost::asio::const_buffers_1` expects a size as second parameter, not the end pointer
1 parent fba104c commit 78fd641

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/network/example/http/fileserver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ struct connection_handler : boost::enable_shared_from_this<connection_handler> {
134134
connection->write(
135135
boost::asio::const_buffers_1(
136136
static_cast<char const *>(mmaped_region.first) + offset,
137-
rightmost_bound),
137+
rightmost_bound - offset),
138138
boost::bind(&connection_handler::handle_chunk,
139139
connection_handler::shared_from_this(), mmaped_region,
140140
rightmost_bound, connection, _1));

0 commit comments

Comments
 (0)