Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit685810c

Browse files
committed
More efficient fileserver example.
This commit makes the fileserver example moreefficient by eliminating the need for copyingthe data into multiple buffers and usingthe newly implemented less-copying overload forwriting to connections.
1 parent8f2276b commit685810c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎libs/network/example/http/fileserver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ struct connection_handler : boost::enable_shared_from_this<connection_handler> {
126126
std::size_t adjusted_offset = offset+4096;
127127
off_t rightmost_bound =std::min(mmaped_region.second, adjusted_offset);
128128
connection->write(
129-
boost::make_iterator_range(
129+
boost::asio::const_buffers_1(
130130
static_cast<charconst *>(mmaped_region.first) + offset,
131-
static_cast<charconst *>(mmaped_region.first) +rightmost_bound
131+
rightmost_bound
132132
)
133133
,boost::bind(
134134
&connection_handler::handle_chunk,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp