Skip to content

Commit

Permalink
Close connection if this command is over max-conn-rbuf-size (#834)
Browse files Browse the repository at this point in the history
Update Pink
  • Loading branch information
whoiami committed Dec 20, 2019
1 parent 4d5b397 commit af3e890
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion include/pika_dispatch_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class PikaDispatchThread {
pink::Thread* server_thread,
void* worker_specific_data,
pink::PinkEpoll* pink_epoll) const {
return std::make_shared<PikaClientConn>(connfd, ip_port, server_thread, pink_epoll, pink::HandleType::kAsynchronous, max_conn_rbuf_size_);
return std::static_pointer_cast<pink::PinkConn>
(std::make_shared<PikaClientConn>(connfd, ip_port, server_thread, pink_epoll, pink::HandleType::kAsynchronous, max_conn_rbuf_size_));
}
private:
int max_conn_rbuf_size_;
Expand Down
3 changes: 2 additions & 1 deletion include/pika_repl_client_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class PikaReplClientThread : public pink::ClientThread {
pink::Thread *thread,
void* worker_specific_data,
pink::PinkEpoll* pink_epoll) const override {
return std::make_shared<PikaReplClientConn>(connfd, ip_port, thread, worker_specific_data, pink_epoll);
return std::static_pointer_cast<pink::PinkConn>
(std::make_shared<PikaReplClientConn>(connfd, ip_port, thread, worker_specific_data, pink_epoll));
}
};
class ReplClientHandle : public pink::ClientHandle {
Expand Down
3 changes: 2 additions & 1 deletion include/pika_repl_server_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class PikaReplServerThread : public pink::HolyThread {
pink::Thread* thread,
void* worker_specific_data,
pink::PinkEpoll* pink_epoll) const override {
return std::make_shared<PikaReplServerConn>(connfd, ip_port, thread, binlog_receiver_, pink_epoll);
return std::static_pointer_cast<pink::PinkConn>
(std::make_shared<PikaReplServerConn>(connfd, ip_port, thread, binlog_receiver_, pink_epoll));
}
private:
PikaReplServerThread* binlog_receiver_;
Expand Down
2 changes: 1 addition & 1 deletion third/pink

0 comments on commit af3e890

Please sign in to comment.