diff options
author | msvensson@pilot.mysql.com <> | 2007-01-29 14:35:09 +0100 |
---|---|---|
committer | msvensson@pilot.mysql.com <> | 2007-01-29 14:35:09 +0100 |
commit | 719a8f5896bbb9effb09a39f31748f7ab8deabc7 (patch) | |
tree | bb2f6dac4fd53c5fa66ba9deb1b2cafbb6a08434 /sql/net_serv.cc | |
parent | df4cfc0bc178c8dfc61e9c07c564ed73b38aeee6 (diff) | |
parent | 007d170ad2af225225844ac258c91b6766fb0a69 (diff) | |
download | mariadb-git-719a8f5896bbb9effb09a39f31748f7ab8deabc7.tar.gz |
Merge pilot.mysql.com:/home/msvensson/mysql/bug22943/my50-bug22943
into pilot.mysql.com:/home/msvensson/mysql/bug22943/my51-bug22943
Diffstat (limited to 'sql/net_serv.cc')
-rw-r--r-- | sql/net_serv.cc | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 7c0e40543a8..ceaac26742b 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -609,7 +609,7 @@ net_real_write(NET *net,const char *packet,ulong len) thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff); #else alarmed=0; - vio_timeout(net->vio, 1, net->write_timeout); + /* Write timeout is set in net_set_write_timeout */ #endif /* NO_ALARM */ pos=(char*) packet; end=pos+len; @@ -802,7 +802,7 @@ my_real_read(NET *net, ulong *complen) if (net_blocking) thr_alarm(&alarmed,net->read_timeout,&alarm_buff); #else - vio_timeout(net->vio, 0, net->read_timeout); + /* Read timeout is set in net_set_read_timeout */ #endif /* NO_ALARM */ pos = net->buff + net->where_b; /* net->packet -4 */ @@ -1113,3 +1113,26 @@ my_net_read(NET *net) return len; } + +void net_set_read_timeout(NET *net, uint timeout) +{ + DBUG_ENTER("net_set_read_timeout"); + DBUG_PRINT("enter", ("timeout: %d", timeout)); + net->read_timeout= timeout; +#ifdef NO_ALARM + vio_timeout(net->vio, 0, timeout); +#endif + DBUG_VOID_RETURN; +} + + +void net_set_write_timeout(NET *net, uint timeout) +{ + DBUG_ENTER("net_set_write_timeout"); + DBUG_PRINT("enter", ("timeout: %d", timeout)); + net->write_timeout= timeout; +#ifdef NO_ALARM + vio_timeout(net->vio, 1, timeout); +#endif + DBUG_VOID_RETURN; +} |