summaryrefslogtreecommitdiff
path: root/storage/ndb/src/common/util/InputStream.cpp
diff options
context:
space:
mode:
authorunknown <stewart@mysql.com[stewart]>2007-03-22 22:33:43 +1100
committerunknown <stewart@mysql.com[stewart]>2007-03-22 22:33:43 +1100
commit8293b317d1cf6961720e033b8951ee403248692f (patch)
tree604ef61ecc912b7bbee159c40182a2f0e8030f19 /storage/ndb/src/common/util/InputStream.cpp
parent45f698c5516eb6d188077e876af82086e8cafba7 (diff)
downloadmariadb-git-8293b317d1cf6961720e033b8951ee403248692f.tar.gz
[PATCH] WL#3704 mgmapi timeouts: Add bool timeout flag to Streams
Index: ndb-work/storage/ndb/include/util/InputStream.hpp =================================================================== storage/ndb/include/util/InputStream.hpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams storage/ndb/include/util/OutputStream.hpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams storage/ndb/src/common/util/InputStream.cpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams storage/ndb/src/common/util/OutputStream.cpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams storage/ndb/src/mgmsrv/Services.cpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams storage/ndb/test/ndbapi/testMgm.cpp: WL#3704 mgmapi timeouts: Add bool timeout flag to Streams
Diffstat (limited to 'storage/ndb/src/common/util/InputStream.cpp')
-rw-r--r--storage/ndb/src/common/util/InputStream.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/storage/ndb/src/common/util/InputStream.cpp b/storage/ndb/src/common/util/InputStream.cpp
index 016985328a1..17703eb7e52 100644
--- a/storage/ndb/src/common/util/InputStream.cpp
+++ b/storage/ndb/src/common/util/InputStream.cpp
@@ -38,10 +38,13 @@ SocketInputStream::SocketInputStream(NDB_SOCKET_TYPE socket,
: m_socket(socket) {
m_startover= true;
m_timeout_ms = read_timeout_ms;
+ m_timedout= false;
}
char*
SocketInputStream::gets(char * buf, int bufLen) {
+ if(timedout())
+ return 0;
assert(bufLen >= 2);
int offset= 0;
if(m_startover)
@@ -63,7 +66,10 @@ SocketInputStream::gets(char * buf, int bufLen) {
m_startover= true;
if(res == -1)
+ {
+ m_timedout= true;
return 0;
+ }
return buf;
}