1 | /* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. |
2 | Copyright (c) 2012, Monty Program Ab |
3 | |
4 | This program is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by |
6 | the Free Software Foundation; version 2 of the License. |
7 | |
8 | This program is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | GNU General Public License for more details. |
12 | |
13 | You should have received a copy of the GNU General Public License |
14 | along with this program; if not, write to the Free Software |
15 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
16 | |
17 | /* |
18 | This files defines some MySQL C API functions that are server specific |
19 | */ |
20 | |
21 | #include "mariadb.h" |
22 | #include "sql_priv.h" |
23 | #include "sql_class.h" // system_variables |
24 | |
25 | /* |
26 | Function called by my_net_init() to set some check variables |
27 | */ |
28 | |
29 | extern "C" { |
30 | void my_net_local_init(NET *net) |
31 | { |
32 | #ifndef EMBEDDED_LIBRARY |
33 | net->max_packet= (uint) global_system_variables.net_buffer_length; |
34 | net->read_timeout= net->write_timeout= 0; |
35 | my_net_set_read_timeout(net, (uint)global_system_variables.net_read_timeout); |
36 | my_net_set_write_timeout(net, |
37 | (uint)global_system_variables.net_write_timeout); |
38 | |
39 | net->retry_count= (uint) global_system_variables.net_retry_count; |
40 | net->max_packet_size= MY_MAX(global_system_variables.net_buffer_length, |
41 | global_system_variables.max_allowed_packet); |
42 | #endif |
43 | } |
44 | } |
45 | |