~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/mysql_protocol/mysql_protocol.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-12-09 06:02:39 UTC
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20101209060239-t0ujftvcvd558yno
Tags: upstream-2010.12.05
ImportĀ upstreamĀ versionĀ 2010.12.05

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#include "net_serv.h"
29
29
 
 
30
namespace drizzle_plugin
 
31
{
 
32
 
 
33
typedef drizzled::constrained_check<in_port_t, 65535, 0> port_constraint;
 
34
typedef drizzled::constrained_check<uint32_t, 300, 1> timeout_constraint;
 
35
typedef drizzled::constrained_check<uint32_t, 300, 1> retry_constraint;
 
36
typedef drizzled::constrained_check<uint32_t, 1048576, 1024, 1024> buffer_constraint;
 
37
 
30
38
class ListenMySQLProtocol: public drizzled::plugin::ListenTcp
31
39
{
32
40
private:
33
 
  bool using_mysql41_protocol;
34
 
  static drizzled::plugin::TableFunction* status_table_function_ptr;
 
41
  const std::string _hostname;
 
42
  bool _using_mysql41_protocol;
35
43
 
36
44
public:
37
 
  ListenMySQLProtocol(std::string name_arg, bool using_mysql41_protocol_arg):
38
 
   drizzled::plugin::ListenTcp(name_arg),
39
 
   using_mysql41_protocol(using_mysql41_protocol_arg)
 
45
  ListenMySQLProtocol(std::string name,
 
46
                      const std::string &hostname,
 
47
                      bool using_mysql41_protocol):
 
48
   drizzled::plugin::ListenTcp(name),
 
49
   _hostname(hostname),
 
50
   _using_mysql41_protocol(using_mysql41_protocol)
40
51
  { }
41
52
  virtual ~ListenMySQLProtocol();
42
 
  virtual const char* getHost(void) const;
 
53
  virtual const std::string getHost(void) const;
43
54
  virtual in_port_t getPort(void) const;
44
55
  virtual drizzled::plugin::Client *getClient(int fd);
45
56
};
50
61
  NET net;
51
62
  drizzled::String packet;
52
63
  uint32_t client_capabilities;
53
 
  bool using_mysql41_protocol;
 
64
  bool _using_mysql41_protocol;
54
65
 
55
66
  bool checkConnection(void);
56
67
  bool netStoreData(const unsigned char *from, size_t length);
59
70
  void makeScramble(char *scramble);
60
71
 
61
72
public:
62
 
  ClientMySQLProtocol(int fd, bool using_mysql41_protocol_arg);
 
73
  ClientMySQLProtocol(int fd, bool _using_mysql41_protocol);
63
74
  virtual ~ClientMySQLProtocol();
64
75
 
65
76
  static drizzled::atomic<uint64_t> connectionCount;
97
108
  virtual bool wasAborted(void);
98
109
};
99
110
 
 
111
} /* namespace drizzle_plugin */
 
112
 
100
113
#endif /* PLUGIN_MYSQL_PROTOCOL_MYSQL_PROTOCOL_H */