diff options
| author | levlam <levlam@telegram.org> | 2021-10-27 20:29:01 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2021-10-27 20:29:01 +0300 |
| commit | 377bd18909b7a602b40e8bb074cdeb2830baef91 (patch) | |
| tree | 8182b822af99721d673a816dd1e46d4f252cfe9f /benchmark | |
| parent | a68d8e77efb03896f3a04fc316c47136b0bab7df (diff) | |
Pass BufferedFd to HttpConnection.
Diffstat (limited to 'benchmark')
| -rw-r--r-- | benchmark/bench_http.cpp | 2 | ||||
| -rw-r--r-- | benchmark/bench_http_server.cpp | 4 | ||||
| -rw-r--r-- | benchmark/bench_http_server_cheat.cpp | 4 | ||||
| -rw-r--r-- | benchmark/bench_http_server_fast.cpp | 2 |
4 files changed, 5 insertions, 7 deletions
diff --git a/benchmark/bench_http.cpp b/benchmark/bench_http.cpp index 7650073e4..5fc8ba1f3 100644 --- a/benchmark/bench_http.cpp +++ b/benchmark/bench_http.cpp @@ -30,7 +30,7 @@ class HttpClient final : public HttpOutboundConnection::Callback { addr.init_ipv4_port("127.0.0.1", 8082).ensure(); auto fd = SocketFd::open(addr); LOG_CHECK(fd.is_ok()) << fd.error(); - connection_ = create_actor<HttpOutboundConnection>("Connect", fd.move_as_ok(), SslStream{}, + connection_ = create_actor<HttpOutboundConnection>("Connect", BufferedFd<SocketFd>(fd.move_as_ok()), SslStream{}, std::numeric_limits<size_t>::max(), 0, 0, ActorOwn<HttpOutboundConnection::Callback>(actor_id(this))); yield(); diff --git a/benchmark/bench_http_server.cpp b/benchmark/bench_http_server.cpp index 82aed1914..4351f03a5 100644 --- a/benchmark/bench_http_server.cpp +++ b/benchmark/bench_http_server.cpp @@ -56,8 +56,8 @@ class Server final : public TcpListener::Callback { LOG(ERROR) << "ACCEPT " << cnt++; pos_++; auto scheduler_id = pos_ % (N != 0 ? N : 1) + (N != 0); - create_actor_on_scheduler<HttpInboundConnection>("HttpInboundConnection", scheduler_id, std::move(fd), 1024 * 1024, - 0, 0, + create_actor_on_scheduler<HttpInboundConnection>("HttpInboundConnection", scheduler_id, + BufferedFd<SocketFd>(std::move(fd)), 1024 * 1024, 0, 0, create_actor_on_scheduler<HelloWorld>("HelloWorld", scheduler_id)) .release(); } diff --git a/benchmark/bench_http_server_cheat.cpp b/benchmark/bench_http_server_cheat.cpp index 1c3455aba..307f8e3a1 100644 --- a/benchmark/bench_http_server_cheat.cpp +++ b/benchmark/bench_http_server_cheat.cpp @@ -5,7 +5,6 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include "td/net/HttpHeaderCreator.h" -#include "td/net/HttpInboundConnection.h" #include "td/net/TcpListener.h" #include "td/actor/actor.h" @@ -22,7 +21,6 @@ namespace td { -// HttpInboundConnection header static int cnt = 0; class HelloWorld final : public Actor { public: @@ -107,7 +105,7 @@ class Server final : public TcpListener::Callback { LOG(ERROR) << "ACCEPT " << cnt++; pos_++; auto scheduler_id = pos_ % (N != 0 ? N : 1) + (N != 0); - create_actor_on_scheduler<HelloWorld>("HttpInboundConnection", scheduler_id, std::move(fd)).release(); + create_actor_on_scheduler<HelloWorld>("HelloWorld", scheduler_id, std::move(fd)).release(); } void hangup() final { // may be it should be default?.. diff --git a/benchmark/bench_http_server_fast.cpp b/benchmark/bench_http_server_fast.cpp index d0a0e115b..28881160e 100644 --- a/benchmark/bench_http_server_fast.cpp +++ b/benchmark/bench_http_server_fast.cpp @@ -93,7 +93,7 @@ class Server final : public TcpListener::Callback { void accept(SocketFd fd) final { pos_++; auto scheduler_id = pos_ % (N != 0 ? N : 1) + (N != 0); - create_actor_on_scheduler<HttpEchoConnection>("HttpInboundConnection", scheduler_id, std::move(fd)).release(); + create_actor_on_scheduler<HttpEchoConnection>("HttpEchoConnection", scheduler_id, std::move(fd)).release(); } void hangup() final { LOG(ERROR) << "Hanging up.."; |
