diff options
Diffstat (limited to 'sql-common/pack.c')
-rw-r--r-- | sql-common/pack.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sql-common/pack.c b/sql-common/pack.c index e363d600e20..16cc13eddbd 100644 --- a/sql-common/pack.c +++ b/sql-common/pack.c @@ -1,7 +1,28 @@ +/* Copyright (C) 2000-2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include <my_global.h> #include <mysql_com.h> #include <mysql.h> +ulong net_buffer_length=8192; +ulong max_allowed_packet= 1024L*1024L*1024L; +ulong net_read_timeout= NET_READ_TIMEOUT; +ulong net_write_timeout= NET_WRITE_TIMEOUT; + /* Get the length of next field. Change parameter to point at fieldstart */ ulong STDCALL net_field_length(uchar **packet) { @@ -62,3 +83,16 @@ my_ulonglong net_field_length_ll(uchar **packet) #endif } +/* + Functions called my my_net_init() to set some application specific variables +*/ + +void my_net_local_init(NET *net) +{ + net->max_packet= (uint) net_buffer_length; + net->read_timeout= (uint) net_read_timeout; + net->write_timeout=(uint) net_write_timeout; + net->retry_count= 1; + net->max_packet_size= max(net_buffer_length, max_allowed_packet); +} + |