summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorjonas@perch.ndb.mysql.com <>2007-05-18 11:07:00 +0200
committerjonas@perch.ndb.mysql.com <>2007-05-18 11:07:00 +0200
commit0cca72782d55d8b3b340c28a0799950676926dc2 (patch)
tree6661f1a48437c905af7ff79d893deccfcef9f938 /ndb
parent85b607cc2019cf7d574d323536929fec868cfd20 (diff)
parentb9fd34a9ff46daeeb71ddff6aea3b98cf49f50e7 (diff)
downloadmariadb-git-0cca72782d55d8b3b340c28a0799950676926dc2.tar.gz
Merge perch.ndb.mysql.com:/home/jonas/src/41-work
into perch.ndb.mysql.com:/home/jonas/src/50-work
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index f8a9e741b80..8294430191d 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -849,22 +849,6 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
return 0;
}
- struct timeval timeout;
-#ifdef NDB_OSE
- // Return directly if there are no TCP transporters configured
-
- if(timeOutMillis <= 1){
- timeout.tv_sec = 0;
- timeout.tv_usec = 1025;
- } else {
- timeout.tv_sec = timeOutMillis / 1000;
- timeout.tv_usec = (timeOutMillis % 1000) * 1000;
- }
-#else
- timeout.tv_sec = timeOutMillis / 1000;
- timeout.tv_usec = (timeOutMillis % 1000) * 1000;
-#endif
-
NDB_SOCKET_TYPE maxSocketValue = -1;
// Needed for TCP/IP connections
@@ -890,6 +874,24 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis)
hasdata |= t->hasReceiveData();
}
+ timeOutMillis = hasdata ? 0 : timeOutMillis;
+
+ struct timeval timeout;
+#ifdef NDB_OSE
+ // Return directly if there are no TCP transporters configured
+
+ if(timeOutMillis <= 1){
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 1025;
+ } else {
+ timeout.tv_sec = timeOutMillis / 1000;
+ timeout.tv_usec = (timeOutMillis % 1000) * 1000;
+ }
+#else
+ timeout.tv_sec = timeOutMillis / 1000;
+ timeout.tv_usec = (timeOutMillis % 1000) * 1000;
+#endif
+
// The highest socket value plus one
maxSocketValue++;