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

Commitf94635c

Browse files
carundeanberris
authored andcommitted
Implemented review comments.
1 parent9909fa4 commitf94635c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ struct connection_handler {
189189
/// @param [in] conn Connection object
190190
///
191191
voidoperator()(server::requestconst& req,const server::connection_ptr& conn) {
192-
staticstd::map<std::string, std::string> headers = {
192+
std::map<std::string, std::string> headers = {
193193
{"Connection","close"},
194194
{"Content-Length","0"},
195195
{"Content-Type","text/plain"}
@@ -225,8 +225,8 @@ struct connection_handler {
225225
conn->write(err);
226226
}
227227
}else {
228-
staticstd::stringbody("Only path allowed is /upload");
229-
headers["Content-Length"] =std::to_string(body.size());
228+
staticconstexprcharbody[] ="Only path allowed is /upload";
229+
headers["Content-Length"] =std::to_string(sizeof(body));
230230
conn->set_status(server::connection::bad_request);
231231
conn->set_headers(headers);
232232
conn->write(body);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void process_request(work_queue& queue) {
125125
// some heavy work!
126126
std::this_thread::sleep_for(std::chrono::seconds(10));
127127

128-
staticstd::map<std::string, std::string> headers = {
128+
std::map<std::string, std::string> headers = {
129129
{"Content-Length","0"},
130130
{"Content-Type","text/plain"},
131131
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct hello_world {
3030
std::ostringstream data;
3131
data <<"Hello," << ip <<':' << port <<'!';
3232

33-
staticstd::map<std::string, std::string> headers = {
33+
std::map<std::string, std::string> headers = {
3434
{"Content-Length","0"},
3535
{"Content-Type","text/plain"},
3636
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp