Skip to content

Commit

Permalink
Merge remote-tracking branch 'td/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
cavallium committed Oct 28, 2021
2 parents 0003911 + 318b782 commit 9b0d54d
Show file tree
Hide file tree
Showing 47 changed files with 448 additions and 460 deletions.
2 changes: 1 addition & 1 deletion benchmark/bench_http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions benchmark/bench_http_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 1 addition & 3 deletions benchmark/bench_http_server_cheat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -22,7 +21,6 @@

namespace td {

// HttpInboundConnection header
static int cnt = 0;
class HelloWorld final : public Actor {
public:
Expand Down Expand Up @@ -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?..
Expand Down
2 changes: 1 addition & 1 deletion benchmark/bench_http_server_fast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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..";
Expand Down
Loading

0 comments on commit 9b0d54d

Please sign in to comment.