forked from vladon/sqlproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmysql_monitor.h
More file actions
35 lines (24 loc) · 764 Bytes
/
mysql_monitor.h
File metadata and controls
35 lines (24 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include "common.h"
#include "mysql_parser.h"
namespace sql_proxy
{
class mysql_monitor : public IProvider
{
public:
explicit mysql_monitor(boost::asio::io_service & io_service);
void on_connect() const override;
void on_downstream_read(bytes_t data) override;
void on_upstream_read(bytes_t data) override;
private:
void dump_data(const bytes_t & data, packet_origin direction);
boost::asio::io_service & io_service_;
boost::asio::io_service::strand strand_;
void on_read(const bytes_t & data, packet_origin direction);
std::mutex downstream_read_mutex_;
std::mutex upstream_read_mutex_;
mutable std::mutex cout_mutex_;
mutable std::mutex dump_mutex_;
mysql_parser mysql_parser_;
};
}