Skip to content

Commit 0e9013c

Browse files
committed
Remove and refactor obsolete APIs
1 parent 3cb7a4e commit 0e9013c

File tree

13 files changed

+20
-650
lines changed

13 files changed

+20
-650
lines changed

example/server/main.cpp

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void install_services(capy::application& app)
5454
http::serializer::config());
5555
}
5656

57+
#if 0
5758
class json_sink : public http::sink
5859
{
5960
public:
@@ -125,28 +126,9 @@ struct do_json_rpc
125126
}
126127

127128
};
129+
#endif
128130

129131
#if 0
130-
auto
131-
my_coro(
132-
http::route_params& rp) ->
133-
capy::task<http::route_result>
134-
{
135-
(void)rp;
136-
asio::thread_pool tp(1);
137-
co_await capy::make_async_op<void>(
138-
[&tp](auto&& handler)
139-
{
140-
asio::post(tp.get_executor(),
141-
[handler = std::move(handler)]() mutable
142-
{
143-
// Simulate some asynchronous work
144-
std::this_thread::sleep_for(std::chrono::seconds(1));
145-
handler();
146-
});
147-
});
148-
co_return http::route::next;
149-
}
150132

151133
auto
152134
do_bcrypt(
@@ -232,12 +214,7 @@ int server_main( int argc, char* argv[] )
232214
do_json_rpc()
233215
);
234216

235-
srv.wwwroot.use(
236-
"/spawn",
237-
http::co_route(my_coro));
238-
srv.wwwroot.use(
239-
"/bcrypt",
240-
http::co_route(do_bcrypt));
217+
srv.wwwroot.use( "/bcrypt", do_bcrypt );
241218

242219
srv.wwwroot.use("/", serve_static( argv[3] ));
243220

example/server/serve_log_admin.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ class serve_log_page
3030

3131
system::error_code
3232
operator()(
33-
http::route_params& p) const
33+
http::route_params&) const
3434
{
35+
return {};
36+
#if 0
3537
auto const v = ls_.get_sections();
3638
std::string s;
3739
format_to(s, "<html>\n");
@@ -75,6 +77,7 @@ class serve_log_page
7577
p.res.set(http::field::content_type, "text/html; charset=UTF-8");
7678
p.set_body(std::move(s));
7779
return http::route::send;
80+
#endif
7881
}
7982

8083
private:
@@ -96,12 +99,15 @@ class handle_submit
9699

97100
system::error_code
98101
operator()(
99-
http::route_params& p) const
102+
http::route_params&) const
100103
{
104+
return {};
105+
#if 0
101106
p.status(http::status::ok);
102107
p.res.set(http::field::content_type, "plain/text; charset=UTF-8");
103108
p.set_body("submit");
104109
return http::route::send;
110+
#endif
105111
}
106112

107113
private:

include/boost/beast2/server/http_server.hpp

Lines changed: 0 additions & 73 deletions
This file was deleted.

include/boost/beast2/server/http_stream.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#ifndef BOOST_BEAST2_SERVER_HTTP_STREAM_HPP
1111
#define BOOST_BEAST2_SERVER_HTTP_STREAM_HPP
1212

13+
#if 0
14+
1315
#include <boost/beast2/detail/config.hpp>
1416
#include <boost/beast2/log_service.hpp>
1517
#include <boost/beast2/error.hpp>
@@ -416,3 +418,5 @@ clear() noexcept
416418
} // boost
417419

418420
#endif
421+
422+
#endif

include/boost/beast2/server/route_handler_corosio.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ class corosio_route_params
3333
: stream(s)
3434
{
3535
}
36-
37-
void do_finish()
38-
{
39-
if(finish_)
40-
{
41-
auto f = std::move(finish_);
42-
finish_ = {};
43-
f();
44-
}
45-
}
4636
};
4737

4838
} // beast2

include/boost/beast2/server/serve_redirect.hpp

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)