91
return new ClientDrizzleProtocol(new_fd, getCounters());
94
static int init(drizzled::module::Context &context)
90
return new (nothrow) ClientDrizzleProtocol(new_fd, using_mysql41_protocol);
93
ClientDrizzleProtocol::ClientDrizzleProtocol(int fd, bool using_mysql41_protocol_arg):
94
using_mysql41_protocol(using_mysql41_protocol_arg)
101
if (drizzleclient_net_init_sock(&net, fd, 0, buffer_length))
104
drizzleclient_net_set_read_timeout(&net, read_timeout);
105
drizzleclient_net_set_write_timeout(&net, write_timeout);
106
net.retry_count=retry_count;
109
ClientDrizzleProtocol::~ClientDrizzleProtocol()
112
drizzleclient_vio_close(net.vio);
115
int ClientDrizzleProtocol::getFileDescriptor(void)
117
return drizzleclient_net_get_sd(&net);
120
bool ClientDrizzleProtocol::isConnected()
125
bool ClientDrizzleProtocol::isReading(void)
127
return net.reading_or_writing == 1;
130
bool ClientDrizzleProtocol::isWriting(void)
132
return net.reading_or_writing == 2;
135
bool ClientDrizzleProtocol::flush()
139
bool ret= drizzleclient_net_write(&net, (unsigned char*) packet.ptr(),
145
void ClientDrizzleProtocol::close(void)
149
drizzleclient_net_close(&net);
150
drizzleclient_net_end(&net);
154
bool ClientDrizzleProtocol::authenticate()
156
bool connection_is_valid;
158
/* Use "connect_timeout" value during connection phase */
159
drizzleclient_net_set_read_timeout(&net, connect_timeout);
160
drizzleclient_net_set_write_timeout(&net, connect_timeout);
162
connection_is_valid= checkConnection();
164
if (connection_is_valid)
168
sendError(session->main_da.sql_errno(), session->main_da.message());
172
/* Connect completed, set read/write timeouts back to default */
173
drizzleclient_net_set_read_timeout(&net, read_timeout);
174
drizzleclient_net_set_write_timeout(&net, write_timeout);
178
bool ClientDrizzleProtocol::readCommand(char **l_packet, uint32_t *packet_length)
181
This thread will do a blocking read from the client which
182
will be interrupted when the next command is received from
183
the client, the connection is closed or "net_wait_timeout"
184
number of seconds has passed
187
/* We can do this much more efficiently with poll timeouts or watcher thread,
188
disabling for now, which means net_wait_timeout == read_timeout. */
189
drizzleclient_net_set_read_timeout(&net,
190
session->variables.net_wait_timeout);
195
*packet_length= drizzleclient_net_read(&net);
196
if (*packet_length == packet_error)
198
/* Check if we can continue without closing the connection */
200
if(net.last_errno== CR_NET_PACKET_TOO_LARGE)
201
my_error(ER_NET_PACKET_TOO_LARGE, MYF(0));
202
if (session->main_da.status() == Diagnostics_area::DA_ERROR)
203
sendError(session->main_da.sql_errno(), session->main_da.message());
208
return false; // We have to close it.
215
*l_packet= (char*) net.read_pos;
218
'packet_length' contains length of data, as it was stored in packet
219
header. In case of malformed header, drizzleclient_net_read returns zero.
220
If packet_length is not zero, drizzleclient_net_read ensures that the returned
221
number of bytes was actually read from network.
222
There is also an extra safety measure in drizzleclient_net_read:
223
it sets packet[packet_length]= 0, but only for non-zero packets.
226
if (*packet_length == 0) /* safety */
228
/* Initialize with COM_SLEEP packet */
229
(*l_packet)[0]= (unsigned char) COM_SLEEP;
232
else if (using_mysql41_protocol)
234
/* Map from MySQL commands to Drizzle commands. */
235
switch ((int)(*l_packet)[0])
239
case 2: /* INIT_DB */
243
case 8: /* SHUTDOWN */
244
(*l_packet)[0]= (unsigned char) COM_SHUTDOWN;
248
(*l_packet)[0]= (unsigned char) COM_SHUTDOWN;
253
/* Just drop connection for MySQL commands we don't support. */
254
(*l_packet)[0]= (unsigned char) COM_QUIT;
260
/* Do not rely on drizzleclient_net_read, extra safety against programming errors. */
261
(*l_packet)[*packet_length]= '\0'; /* safety */
264
/* See comment above. */
265
/* Restore read timeout value */
266
drizzleclient_net_set_read_timeout(&net,
267
session->variables.net_read_timeout);
274
Return ok to the client.
276
The ok packet has the following structure:
278
- 0 : Marker (1 byte)
279
- affected_rows : Stored in 1-9 bytes
280
- id : Stored in 1-9 bytes
281
- server_status : Copy of session->server_status; Can be used by client
282
to check if we are inside an transaction.
284
- warning_count : Stored in 2 bytes; New in 4.1 client
285
- message : Stored as packed length (1-9 bytes) + message.
286
Is not stored if no message.
288
@param session Thread handler
289
@param affected_rows Number of rows changed by statement
290
@param id Auto_increment id for first row (if used)
291
@param message Message to send to the client (Used by mysql_status)
294
void ClientDrizzleProtocol::sendOK()
296
unsigned char buff[DRIZZLE_ERRMSG_SIZE+10],*pos;
297
const char *message= NULL;
300
if (!net.vio) // hack for re-parsing queries
305
buff[0]=0; // No fields
306
if (session->main_da.status() == Diagnostics_area::DA_OK)
308
if (client_capabilities & CLIENT_FOUND_ROWS && session->main_da.found_rows())
309
pos=drizzleclient_net_store_length(buff+1,session->main_da.found_rows());
311
pos=drizzleclient_net_store_length(buff+1,session->main_da.affected_rows());
312
pos=drizzleclient_net_store_length(pos, session->main_da.last_insert_id());
313
int2store(pos, session->main_da.server_status());
315
tmp= min(session->main_da.total_warn_count(), (uint32_t)65535);
316
message= session->main_da.message();
320
pos=drizzleclient_net_store_length(buff+1,0);
321
pos=drizzleclient_net_store_length(pos, 0);
322
int2store(pos, session->server_status);
324
tmp= min(session->total_warn_count, (uint32_t)65535);
327
/* We can only return up to 65535 warnings in two bytes */
331
session->main_da.can_overwrite_status= true;
333
if (message && message[0])
335
size_t length= strlen(message);
336
pos=drizzleclient_net_store_length(pos,length);
337
memcpy(pos,(unsigned char*) message,length);
340
drizzleclient_net_write(&net, buff, (size_t) (pos-buff));
341
drizzleclient_net_flush(&net);
343
session->main_da.can_overwrite_status= false;
347
Send eof (= end of result set) to the client.
349
The eof packet has the following structure:
351
- 254 (DRIZZLE_PROTOCOL_NO_MORE_DATA) : Marker (1 byte)
352
- warning_count : Stored in 2 bytes; New in 4.1 client
353
- status_flag : Stored in 2 bytes;
354
For flags like SERVER_MORE_RESULTS_EXISTS.
356
Note that the warning count will not be sent if 'no_flush' is set as
357
we don't want to report the warning count until all data is sent to the
361
void ClientDrizzleProtocol::sendEOF()
363
/* Set to true if no active vio, to work well in case of --init-file */
366
session->main_da.can_overwrite_status= true;
367
writeEOFPacket(session->main_da.server_status(),
368
session->main_da.total_warn_count());
369
drizzleclient_net_flush(&net);
370
session->main_da.can_overwrite_status= false;
372
packet.shrink(buffer_length);
376
void ClientDrizzleProtocol::sendError(uint32_t sql_errno, const char *err)
380
buff[]: sql_errno:2 + ('#':1 + SQLSTATE_LENGTH:5) + DRIZZLE_ERRMSG_SIZE:512
382
unsigned char buff[2+1+SQLSTATE_LENGTH+DRIZZLE_ERRMSG_SIZE], *pos;
385
assert(err && err[0]);
388
It's one case when we can push an error even though there
389
is an OK or EOF already.
391
session->main_da.can_overwrite_status= true;
393
/* Abort multi-result sets */
394
session->server_status&= ~SERVER_MORE_RESULTS_EXISTS;
397
Send a error string to client.
399
For SIGNAL/RESIGNAL and GET DIAGNOSTICS functionality it's
400
critical that every error that can be intercepted is issued in one
401
place only, my_message_sql.
409
int2store(buff,sql_errno);
412
/* The first # is to make the client backward compatible */
414
pos= (unsigned char*) strcpy((char*) buff+3, drizzle_errno_to_sqlstate(sql_errno));
415
pos+= strlen(drizzle_errno_to_sqlstate(sql_errno));
417
char *tmp= strncpy((char*)pos, err, DRIZZLE_ERRMSG_SIZE-1);
418
tmp+= strlen((char*)pos);
420
length= (uint32_t)(tmp-(char*)buff);
423
drizzleclient_net_write_command(&net,(unsigned char) 255, (unsigned char*) "", 0, (unsigned char*) err, length);
425
session->main_da.can_overwrite_status= false;
429
Send name and type of result to client.
431
Sum fields has table name empty and field_name.
433
@param Session Thread data object
434
@param list List of items to send to client
435
@param flag Bit mask with the following functions:
436
- 1 send number of rows
437
- 2 send default values
438
- 4 don't write eof packet
443
1 Error (Note that in this case the error is not sent to the
446
bool ClientDrizzleProtocol::sendFields(List<Item> *list)
448
List_iterator_fast<Item> it(*list);
450
unsigned char buff[80];
451
String tmp((char*) buff,sizeof(buff),&my_charset_bin);
453
unsigned char *row_pos= drizzleclient_net_store_length(buff, list->elements);
454
(void) drizzleclient_net_write(&net, buff, (size_t) (row_pos-buff));
460
item->make_field(&field);
464
if (store(STRING_WITH_LEN("def")) ||
465
store(field.db_name) ||
466
store(field.table_name) ||
467
store(field.org_table_name) ||
468
store(field.col_name) ||
469
store(field.org_col_name) ||
470
packet.realloc(packet.length()+12))
473
/* Store fixed length fields */
474
pos= (char*) packet.ptr()+packet.length();
475
*pos++= 12; // Length of packed fields
477
int2store(pos, field.charsetnr);
478
int4store(pos+2, field.length);
480
if (using_mysql41_protocol)
482
/* Switch to MySQL field numbering. */
485
case DRIZZLE_TYPE_LONG:
489
case DRIZZLE_TYPE_DOUBLE:
493
case DRIZZLE_TYPE_NULL:
497
case DRIZZLE_TYPE_TIMESTAMP:
501
case DRIZZLE_TYPE_LONGLONG:
505
case DRIZZLE_TYPE_DATETIME:
509
case DRIZZLE_TYPE_DATE:
513
case DRIZZLE_TYPE_VARCHAR:
517
case DRIZZLE_TYPE_DECIMAL:
521
case DRIZZLE_TYPE_ENUM:
525
case DRIZZLE_TYPE_BLOB:
532
/* Add one to compensate for tinyint removal from enum. */
533
pos[6]= field.type + 1;
536
int2store(pos+7,field.flags);
537
pos[9]= (char) field.decimals;
538
pos[10]= 0; // For the future
539
pos[11]= 0; // For the future
542
packet.length((uint32_t) (pos - packet.ptr()));
548
Mark the end of meta-data result set, and store session->server_status,
549
to show that there is no cursor.
550
Send no warning information, as it will be sent at statement end.
552
writeEOFPacket(session->server_status, session->total_warn_count);
556
my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES),
561
bool ClientDrizzleProtocol::store(Field *from)
565
char buff[MAX_FIELD_WIDTH];
566
String str(buff,sizeof(buff), &my_charset_bin);
570
return netStoreData((const unsigned char *)str.ptr(), str.length());
573
bool ClientDrizzleProtocol::store(void)
577
return packet.append(buff, sizeof(buff), PACKET_BUFFER_EXTRA_ALLOC);
580
bool ClientDrizzleProtocol::store(int32_t from)
583
return netStoreData((unsigned char*) buff,
584
(size_t) (internal::int10_to_str(from, buff, -10) - buff));
587
bool ClientDrizzleProtocol::store(uint32_t from)
590
return netStoreData((unsigned char*) buff,
591
(size_t) (internal::int10_to_str(from, buff, 10) - buff));
594
bool ClientDrizzleProtocol::store(int64_t from)
597
return netStoreData((unsigned char*) buff,
598
(size_t) (internal::int64_t10_to_str(from, buff, -10) - buff));
601
bool ClientDrizzleProtocol::store(uint64_t from)
604
return netStoreData((unsigned char*) buff,
605
(size_t) (internal::int64_t10_to_str(from, buff, 10) - buff));
608
bool ClientDrizzleProtocol::store(double from, uint32_t decimals, String *buffer)
610
buffer->set_real(from, decimals, session->charset());
611
return netStoreData((unsigned char*) buffer->ptr(), buffer->length());
614
bool ClientDrizzleProtocol::store(const char *from, size_t length)
616
return netStoreData((const unsigned char *)from, length);
619
bool ClientDrizzleProtocol::wasAborted(void)
621
return net.error && net.vio != 0;
624
bool ClientDrizzleProtocol::haveMoreData(void)
626
return drizzleclient_net_more_data(&net);
629
bool ClientDrizzleProtocol::haveError(void)
631
return net.error || net.vio == 0;
634
bool ClientDrizzleProtocol::checkConnection(void)
644
if (drizzleclient_net_peer_addr(&net, ip, &peer_port, NI_MAXHOST))
646
my_error(ER_BAD_HOST_ERROR, MYF(0), session->getSecurityContext().getIp().c_str());
650
session->getSecurityContext().setIp(ip);
652
drizzleclient_net_keepalive(&net, true);
654
uint32_t server_capabilites;
656
/* buff[] needs to big enough to hold the server_version variable */
657
char buff[SERVER_VERSION_LENGTH + SCRAMBLE_LENGTH + 64];
659
server_capabilites= CLIENT_BASIC_FLAGS;
661
if (using_mysql41_protocol)
662
server_capabilites|= CLIENT_PROTOCOL_MYSQL41;
665
server_capabilites|= CLIENT_COMPRESS;
666
#endif /* HAVE_COMPRESS */
668
end= buff + strlen(PANDORA_RELEASE_VERSION);
669
if ((end - buff) >= SERVER_VERSION_LENGTH)
670
end= buff + (SERVER_VERSION_LENGTH - 1);
671
memcpy(buff, PANDORA_RELEASE_VERSION, end - buff);
675
int4store((unsigned char*) end, global_thread_id);
678
/* We don't use scramble anymore. */
679
memset(end, 'X', SCRAMBLE_LENGTH_323);
680
end+= SCRAMBLE_LENGTH_323;
681
*end++= 0; /* an empty byte for some reason */
683
int2store(end, server_capabilites);
684
/* write server characteristics: up to 16 bytes allowed */
685
end[2]=(char) default_charset_info->number;
686
int2store(end+3, session->server_status);
687
memset(end+5, 0, 13);
690
/* Write scramble tail. */
691
memset(end, 'X', SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323);
692
end+= (SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323);
693
*end++= 0; /* an empty byte for some reason */
695
/* At this point we write connection message and read reply */
696
if (drizzleclient_net_write_command(&net
697
, (unsigned char) PROTOCOL_VERSION
698
, (unsigned char*) ""
700
, (unsigned char*) buff
701
, (size_t) (end-buff))
702
|| (pkt_len= drizzleclient_net_read(&net)) == packet_error
703
|| pkt_len < MIN_HANDSHAKE_SIZE)
705
my_error(ER_HANDSHAKE_ERROR, MYF(0), session->getSecurityContext().getIp().c_str());
709
if (packet.alloc(buffer_length))
710
return false; /* The error is set by alloc(). */
712
client_capabilities= uint2korr(net.read_pos);
715
client_capabilities|= ((uint32_t) uint2korr(net.read_pos + 2)) << 16;
716
session->max_client_packet_length= uint4korr(net.read_pos + 4);
717
end= (char*) net.read_pos + 32;
720
Disable those bits which are not supported by the server.
721
This is a precautionary measure, if the client lies. See Bug#27944.
723
client_capabilities&= server_capabilites;
725
if (end >= (char*) net.read_pos + pkt_len + 2)
727
my_error(ER_HANDSHAKE_ERROR, MYF(0), session->getSecurityContext().getIp().c_str());
731
net.return_status= &session->server_status;
734
char *passwd= strchr(user, '\0')+1;
735
uint32_t user_len= passwd - user - 1;
739
Old clients send null-terminated string as password; new clients send
740
the size (1 byte) + string (not null-terminated). Hence in case of empty
741
password both send '\0'.
743
This strlen() can't be easily deleted without changing client.
745
Cast *passwd to an unsigned char, so that it doesn't extend the sign for
746
*passwd > 127 and become 2**32-127+ after casting to uint.
748
uint32_t passwd_len= client_capabilities & CLIENT_SECURE_CONNECTION ?
749
(unsigned char)(*passwd++) : strlen(passwd);
750
l_db= client_capabilities & CLIENT_CONNECT_WITH_DB ? l_db + passwd_len + 1 : 0;
752
/* strlen() can't be easily deleted without changing client */
753
uint32_t db_len= l_db ? strlen(l_db) : 0;
755
if (passwd + passwd_len + db_len > (char *) net.read_pos + pkt_len)
757
my_error(ER_HANDSHAKE_ERROR, MYF(0), session->getSecurityContext().getIp().c_str());
761
/* If username starts and ends in "'", chop them off */
762
if (user_len > 1 && user[0] == '\'' && user[user_len - 1] == '\'')
769
session->getSecurityContext().setUser(user);
771
return session->checkUser(passwd, passwd_len, l_db);
774
bool ClientDrizzleProtocol::netStoreData(const unsigned char *from, size_t length)
776
size_t packet_length= packet.length();
778
The +9 comes from that strings of length longer than 16M require
779
9 bytes to be stored (see drizzleclient_net_store_length).
781
if (packet_length+9+length > packet.alloced_length() &&
782
packet.realloc(packet_length+9+length))
784
unsigned char *to= drizzleclient_net_store_length((unsigned char*) packet.ptr()+packet_length, length);
785
memcpy(to,from,length);
786
packet.length((size_t) (to+length-(unsigned char*) packet.ptr()));
791
Format EOF packet according to the current client and
792
write it to the network output buffer.
795
void ClientDrizzleProtocol::writeEOFPacket(uint32_t server_status,
796
uint32_t total_warn_count)
798
unsigned char buff[5];
800
Don't send warn count during SP execution, as the warn_list
801
is cleared between substatements, and mysqltest gets confused
803
uint32_t tmp= min(total_warn_count, (uint32_t)65535);
804
buff[0]= DRIZZLE_PROTOCOL_NO_MORE_DATA;
805
int2store(buff+1, tmp);
807
The following test should never be true, but it's better to do it
808
because if 'is_fatal_error' is set the server is not going to execute
809
other queries (see the if test in dispatch_command / COM_QUERY)
811
if (session->is_fatal_error)
812
server_status&= ~SERVER_MORE_RESULTS_EXISTS;
813
int2store(buff + 3, server_status);
814
drizzleclient_net_write(&net, buff, 5);
817
static int init(module::Context &context)
96
819
const module::option_map &vm= context.getOptions();
98
ListenDrizzleProtocol *protocol=new ListenDrizzleProtocol("drizzle_protocol", vm["bind-address"].as<std::string>(), true);
99
protocol->addCountersToTable();
100
context.add(protocol);
101
context.registerVariable(new sys_var_constrained_value_readonly<in_port_t>("port", port));
102
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("connect_timeout", connect_timeout));
103
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("read_timeout", read_timeout));
104
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("write_timeout", write_timeout));
105
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("retry_count", retry_count));
106
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("buffer_length", buffer_length));
107
context.registerVariable(new sys_var_const_string_val("bind_address",
108
vm["bind-address"].as<std::string>()));
110
context.registerVariable(new sys_var_uint32_t_ptr("max-connections", &ListenDrizzleProtocol::drizzle_counters->max_connections));
820
if (vm.count("port"))
824
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of port\n"));
829
if (vm.count("connect-timeout"))
831
if (connect_timeout < 1 || connect_timeout > 300)
833
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for connect_timeout\n"));
838
if (vm.count("read-timeout"))
840
if (read_timeout < 1 || read_timeout > 300)
842
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for read_timeout\n"));
847
if (vm.count("write-timeout"))
849
if (write_timeout < 1 || write_timeout > 300)
851
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for write_timeout\n"));
856
if (vm.count("retry-count"))
858
if (retry_count < 1 || retry_count > 100)
860
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for retry_count\n"));
865
if (vm.count("buffer-length"))
867
if (buffer_length < 1024 || buffer_length > 1024*1024)
869
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for buffer_length\n"));
874
if (vm.count("bind-address"))
876
bind_address= strdup(vm["bind-address"].as<string>().c_str());
884
context.add(new ListenDrizzleProtocol("drizzle_protocol", false));
888
static DRIZZLE_SYSVAR_UINT(port, port, PLUGIN_VAR_RQCMDARG,
889
N_("Port number to use for connection or 0 for "
890
"default to, in order of "
891
"preference, drizzle.cnf, $DRIZZLE_TCP_PORT, "
892
"built-in default (4427)."),
893
NULL, NULL, 0, 0, 65535, 0);
894
static DRIZZLE_SYSVAR_UINT(connect_timeout, connect_timeout,
895
PLUGIN_VAR_RQCMDARG, N_("Connect Timeout."),
896
NULL, NULL, 10, 1, 300, 0);
897
static DRIZZLE_SYSVAR_UINT(read_timeout, read_timeout, PLUGIN_VAR_RQCMDARG,
898
N_("Read Timeout."), NULL, NULL, 30, 1, 300, 0);
899
static DRIZZLE_SYSVAR_UINT(write_timeout, write_timeout, PLUGIN_VAR_RQCMDARG,
900
N_("Write Timeout."), NULL, NULL, 60, 1, 300, 0);
901
static DRIZZLE_SYSVAR_UINT(retry_count, retry_count, PLUGIN_VAR_RQCMDARG,
902
N_("Retry Count."), NULL, NULL, 10, 1, 100, 0);
903
static DRIZZLE_SYSVAR_UINT(buffer_length, buffer_length, PLUGIN_VAR_RQCMDARG,
904
N_("Buffer length."), NULL, NULL, 16384, 1024,
906
static DRIZZLE_SYSVAR_STR(bind_address, bind_address, PLUGIN_VAR_READONLY,
907
N_("Address to bind to."), NULL, NULL, NULL);
116
909
static void init_options(drizzled::module::option_context &context)
119
po::value<port_constraint>(&port)->default_value(DRIZZLE_TCP_PORT),
120
N_("Port number to use for connection or 0 for default to with Drizzle/MySQL protocol."));
912
po::value<uint32_t>(&port)->default_value(0),
913
N_("Port number to use for connection or 0 for "
914
"default to, in order of "
915
"preference, drizzle.cnf, $DRIZZLE_TCP_PORT, "
916
"built-in default (4427)."));
121
917
context("connect-timeout",
122
po::value<timeout_constraint>(&connect_timeout)->default_value(10),
918
po::value<uint32_t>(&connect_timeout)->default_value(10),
123
919
N_("Connect Timeout."));
124
920
context("read-timeout",
125
po::value<timeout_constraint>(&read_timeout)->default_value(30),
921
po::value<uint32_t>(&read_timeout)->default_value(30),
126
922
N_("Read Timeout."));
127
923
context("write-timeout",
128
po::value<timeout_constraint>(&write_timeout)->default_value(60),
924
po::value<uint32_t>(&write_timeout)->default_value(60),
129
925
N_("Write Timeout."));
130
926
context("retry-count",
131
po::value<retry_constraint>(&retry_count)->default_value(10),
927
po::value<uint32_t>(&retry_count)->default_value(10),
132
928
N_("Retry Count."));
133
929
context("buffer-length",
134
po::value<buffer_constraint>(&buffer_length)->default_value(16384),
930
po::value<uint32_t>(&buffer_length)->default_value(16384),
135
931
N_("Buffer length."));
136
932
context("bind-address",
137
po::value<std::string>()->default_value(""),
138
934
N_("Address to bind to."));
139
context("max-connections",
140
po::value<uint32_t>(&ListenDrizzleProtocol::drizzle_counters->max_connections)->default_value(1000),
141
N_("Maximum simultaneous connections."));
142
context("admin-ip-addresses",
143
po::value<vector<string> >()->composing()->notifier(&ClientDrizzleProtocol::drizzle_compose_ip_addresses),
144
N_("A restrictive IP address list for incoming admin connections."));
937
static drizzle_sys_var* sys_variables[]= {
938
DRIZZLE_SYSVAR(port),
939
DRIZZLE_SYSVAR(connect_timeout),
940
DRIZZLE_SYSVAR(read_timeout),
941
DRIZZLE_SYSVAR(write_timeout),
942
DRIZZLE_SYSVAR(retry_count),
943
DRIZZLE_SYSVAR(buffer_length),
944
DRIZZLE_SYSVAR(bind_address),
147
948
} /* namespace drizzle_protocol */
148
} /* namespace drizzle_plugin */
150
DRIZZLE_PLUGIN(drizzle_plugin::drizzle_protocol::init, NULL, drizzle_plugin::drizzle_protocol::init_options);
950
DRIZZLE_PLUGIN(drizzle_protocol::init, drizzle_protocol::sys_variables, drizzle_protocol::init_options);