List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:March 9 2007 11:50am
Subject:bk commit into 5.1 tree (stewart:1.2476)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of stewart. When stewart does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-03-09 11:50:33+01:00, stewart@stripped +3 -0
  [PATCH] Correct cpc client usage of Socket Input/OutputStream for timeouts
  
  Index: ndb-work/storage/ndb/include/util/InputStream.hpp
  ===================================================================

  storage/ndb/include/util/InputStream.hpp@stripped, 2007-03-09 10:39:27+01:00,
stewart@stripped +1 -1
    Correct cpc client usage of Socket Input/OutputStream for timeouts

  storage/ndb/test/include/CpcClient.hpp@stripped, 2007-03-09 11:07:50+01:00, stewart@stripped
+0 -2
    Correct cpc client usage of Socket Input/OutputStream for timeouts

  storage/ndb/test/src/CpcClient.cpp@stripped, 2007-03-09 11:10:36+01:00, stewart@stripped +9
-17
    Correct cpc client usage of Socket Input/OutputStream for timeouts

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	stewart
# Host:	willster.(none)
# Root:	/home/stewart/Documents/MySQL/5.1/telco-wl3704

--- 1.13/storage/ndb/include/util/InputStream.hpp	2007-03-08 10:04:50 +01:00
+++ 1.14/storage/ndb/include/util/InputStream.hpp	2007-03-09 10:39:27 +01:00
@@ -53,7 +53,7 @@
   bool m_startover;
   bool m_timedout;
 public:
-  SocketInputStream(NDB_SOCKET_TYPE socket, unsigned read_timeout_ms = 1000);
+  SocketInputStream(NDB_SOCKET_TYPE socket, unsigned read_timeout_ms = 60000);
   virtual ~SocketInputStream() {}
   char* gets(char * buf, int bufLen);
   bool timedout() { return m_timedout; };

--- 1.13/storage/ndb/test/src/CpcClient.cpp	2006-12-23 20:20:30 +01:00
+++ 1.14/storage/ndb/test/src/CpcClient.cpp	2007-03-09 11:10:36 +01:00
@@ -428,8 +428,6 @@
   host = strdup(_host);
   port = _port;
   cpc_sock = -1;
-  cpc_in = NULL;
-  cpc_out = NULL;
 }
 
 SimpleCpcClient::~SimpleCpcClient() {
@@ -444,12 +442,6 @@
     close(cpc_sock);
     cpc_sock = -1;
   }
-
-  if(cpc_in != NULL)
-    delete cpc_in;
-
-  if(cpc_out != NULL)
-    delete cpc_out;
 }
 
 int
@@ -475,17 +467,15 @@
   if (::connect(cpc_sock, (struct sockaddr*) &sa, sizeof(sa)) < 0)
     return -1;
 
-  cpc_in = new SocketInputStream(cpc_sock, 60000);
-  cpc_out = new SocketOutputStream(cpc_sock);
-  
   return 0;
 }
 
 int
 SimpleCpcClient::cpc_send(const char *cmd,
 			  const Properties &args) {
-  
-  cpc_out->println(cmd);
+  SocketOutputStream cpc_out(cpc_sock);
+
+  cpc_out.println(cmd);
 
   Properties::Iterator iter(&args);
   const char *name;
@@ -498,18 +488,18 @@
     switch(t) {
     case PropertiesType_Uint32:
       args.get(name, &val_i);
-      cpc_out->println("%s: %d", name, val_i);
+      cpc_out.println("%s: %d", name, val_i);
       break;
     case PropertiesType_char:
       args.get(name, val_s);
-      cpc_out->println("%s: %s", name, val_s.c_str());
+      cpc_out.println("%s: %s", name, val_s.c_str());
       break;
     default:
       /* Silently ignore */
       break;
     }
   }
-  cpc_out->println("");
+  cpc_out.println("");
 
   return 0;
 }
@@ -523,9 +513,11 @@
 SimpleCpcClient::cpc_recv(const ParserRow_t *syntax,
 			  const Properties **reply,
 			  void **user_value) {
+  SocketInputStream cpc_in(cpc_sock);
+
   Parser_t::Context ctx;
   ParserDummy session(cpc_sock);
-  Parser_t parser(syntax, *cpc_in, true, true, true);
+  Parser_t parser(syntax, cpc_in, true, true, true);
   *reply = parser.parse(ctx, session);
   if(user_value != NULL)
     *user_value = ctx.m_currentCmd->user_value;

--- 1.5/storage/ndb/test/include/CpcClient.hpp	2006-12-23 20:20:23 +01:00
+++ 1.6/storage/ndb/test/include/CpcClient.hpp	2007-03-09 11:07:50 +01:00
@@ -70,8 +70,6 @@
   char *host;
   int port;
   NDB_SOCKET_TYPE cpc_sock;
-  InputStream *cpc_in;
-  OutputStream *cpc_out;
 
 public:  
   int connect();
Thread
bk commit into 5.1 tree (stewart:1.2476)Stewart Smith9 Mar