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

Commitc044741

Browse files
committed
Adding missing files.
1 parent90a1b0b commitc044741

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

‎http/src/http/server/connection.hpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2013 (c) Google, Inc.
2+
// Copyright 2013 (c) Dean Michael Berris <dberris@google.com>
3+
// Distributed under the Boost Software License, Version 1.0.
4+
// (See accompanying file LICENSE_1_0.txt or copy at
5+
// http://www.boost.org/LICENSE_1_0.txt)
6+
7+
#ifndef NETWORK_HTTP_SERVER_CONNECTION_HPP_20130410
8+
#defineNETWORK_HTTP_SERVER_CONNECTION_HPP_20130410
9+
10+
namespacenetwork {
11+
namespacehttp {
12+
13+
structconnection {
14+
};
15+
16+
}// namespace http
17+
}// namespace network
18+
19+
#endif/* end of include guard: NETWORK_HTTP_SERVER_CONNECTION_HPP_20130410*/
20+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2013 (c) Google, Inc.
2+
// Copyright 2013 (c) Dean Michael Berris <dberris@google.com>
3+
// Distributed under the Boost Software License, Version 1.0.
4+
// (See accompanying file LICENSE_1_0.txt or copy at
5+
// http://www.boost.org/LICENSE_1_0.txt)
6+
7+
#include<http/src/http/server/dynamic_dispatcher.hpp>
8+
9+
namespacenetwork {
10+
namespacehttp {
11+
12+
voiddynamic_dispatcher::register_handler(boost::string_ref pattern, std::function<void(session&, std::shared_ptr<connection>)> handler) {
13+
auto inserted = handlers_.insert(make_pair(static_cast<std::string>(pattern),
14+
handler));
15+
if (!inserted.second)
16+
inserted.first->second = handler;
17+
}
18+
19+
voiddynamic_dispatcher::dispatch(boost::string_ref path, session& s, std::shared_ptr<connection> c) {
20+
auto entry = handlers_.find(static_cast<std::string>(path));
21+
if (entry != handlers_.end()) {
22+
entry->second(s, c);
23+
}
24+
}
25+
26+
}// namespace http
27+
}// namespace network

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp