Skip to contentSkip to conversation

conga ./conga.spec.in.in luci/conga_ssl/SSLCli ...

Cluster-devel [email protected] 1 participant 1 message Mar 27, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2007-03-27 03:11:04

Modified files:
. : conga.spec.in.in
luci/conga_ssl : SSLClient.cpp conga_ssl_lib.cpp setup.py
ricci/common : ClientSocket.cpp Makefile Socket.cpp Time.cpp
XML.cpp
ricci/include : Socket.h ricci/modules/cluster/clumon/src/daemon: Monitor.cpp Monitor.h
ricci/ricci : Ricci.cpp
Added files:
ricci/common : Network.cpp
ricci/include : Network.h
ricci/test_suite: SSLClient_send_to_ricci

Log message:
- Fix a bug that caused connect(2) to block under some circumstances.
- Fix bugs that caused intermittent failures for some systems when accessing the "storage" tab in luci.
- Include a new test script that uses the conga SSL python module.
- Upgrade to Zope 2.8.9.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.26&r2=1.45.2.27
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/conga_ssl/SSLClient.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/conga_ssl/conga_ssl_lib.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/conga_ssl/setup.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.1&r2=1.1.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/Network.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/ClientSocket.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4&r2=1.4.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6.2.1&r2=1.6.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/Socket.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3&r2=1.3.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/Time.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4&r2=1.4.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/XML.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6.2.1&r2=1.6.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Network.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Socket.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3&r2=1.3.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.10.2.3&r2=1.10.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/Monitor.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5&r2=1.5.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/Ricci.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.18.2.4&r2=1.18.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/SSLClient_send_to_ricci.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.4.1

conga.spec.in.in +1 -0
@@ -285,6 +285,7 @@
 %changelog
 
 * Tue Mar 20 2007 Stanko Kupcevic <[email protected]> 0.8-31
+- Upgrade to Zope 2.9.7-final
 - Fixed bz229027 (luci failover domain forms are missing/empty)
 - Fixed bz230447 (fence_xvm is incorrectly listed as "xmv" in virtual cluster)
 - Fixed bz230452 (Advanced options parameters settings don't do anything)
luci/conga_ssl/SSLClient.cpp +3 -3
@@ -81,14 +81,14 @@
   if (!SSL_CTX_load_verify_locations(ctx, 
 				     _trust_CAs, 
 				     NULL))
-    cout << "failed to load trusted CAs" << endl;
+    ;//cout << "failed to load trusted CAs" << endl;
   
   STACK_OF(X509_NAME) *cert_names = 
     SSL_load_client_CA_file(_trust_CAs);
   if (cert_names)
     SSL_CTX_set_client_CA_list(ctx, cert_names);
-  else
-    cout << "failed to load trusted CAs" << endl;
+//  else
+//    cout << "failed to load trusted CAs" << endl;
   
   // load saved certs
   
luci/conga_ssl/conga_ssl_lib.cpp +1 -1
@@ -133,7 +133,7 @@
     counting_auto_ptr<SSLClient> ss;
     {
       PythonThreadsAllower all;
-      ClientSocket sock(hostname, port);
+      ClientSocket sock(hostname, port, timeout * 1000);
       ss = counting_auto_ptr<SSLClient>(new SSLClient(sock));
       ss->connect(timeout * 1000);
     }
luci/conga_ssl/setup.py +1 -0
@@ -13,6 +13,7 @@
                                'SSLClient.cpp', 
                                '../../ricci/common/ClientSocket.cpp', 
                                '../../ricci/common/Socket.cpp', 
+                               '../../ricci/common/Network.cpp', 
                                '../../ricci/common/Logger.cpp', 
                                '../../ricci/common/Time.cpp', 
                                '../../ricci/common/File.cpp', 

/cvs/cluster/conga/ricci/common/Network.cpp,v --> standard output revision 1.1.4.1

- renamed from ricci/common/Network.cpp +84 -0

84 lines not on this page · raw message

ricci/common/ClientSocket.cpp +72 -25

161 lines not on this page · raw message

ricci/common/Makefile +2 -1
@@ -24,10 +24,11 @@
 	utils.o \
 	File.o \
 	XML.o \
+	Network.o \
 	Socket.o \
 	ServerSocket.o \
-	Logger.o \
 	ClientSocket.o \
+	Logger.o \
 	Variable.o \
 	Random.o \
 	daemon_init.o \
ricci/common/Socket.cpp +1 -21
@@ -1,5 +1,5 @@
 /*
-  Copyright Red Hat, Inc. 2005
+  Copyright Red Hat, Inc. 2005-2007
 
   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
@@ -181,23 +181,3 @@
     }
   }
 }
-
-
-
-std::vector<String>
-name2IP(const String& hostname)
-{
-  char buff[INET_ADDRSTRLEN+1];
-  std::vector<String> addrs;
-  struct hostent* ent = gethostbyname2(hostname.c_str(), AF_INET);
-  if (!ent)
-    return addrs;
-  char** addrs_b = ent->h_addr_list;
-  for (int i=0; addrs_b[i]; i++) {
-    struct in_addr addr;
-    addr.s_addr = *((u_int32_t*) addrs_b[i]);
-    if (inet_ntop(AF_INET, &addr, buff, sizeof(buff)))
-      addrs.push_back(buff);
-  }
-  return addrs;
-}
ricci/common/Time.cpp +3 -5
@@ -1,5 +1,5 @@
 /*
-  Copyright Red Hat, Inc. 2005
+  Copyright Red Hat, Inc. 2005-2007
 
   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
@@ -31,8 +31,7 @@
 time_sec()
 {
   struct timeval t;
-  struct timezone z;
-  gettimeofday(&t, &z);
+  gettimeofday(&t, NULL);
   return t.tv_sec;
 }
 
@@ -40,8 +39,7 @@
 time_mil()
 {
   struct timeval t;
-  struct timezone z;
-  gettimeofday(&t, &z);
+  gettimeofday(&t, NULL);
   return t.tv_sec*1000 + t.tv_usec/1000;
 }
 
ricci/common/XML.cpp +2 -2
@@ -189,7 +189,7 @@
 			      xml.size(),
 			      "noname.xml",
 			      NULL,
-			      XML_PARSE_NONET);
+			      XML_PARSE_NONET | XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
   if (!doc)
     throw String("parseXML(): couldn't parse xml");
   
@@ -216,7 +216,7 @@
 			      xml.size(),
 			      "noname.xml",
 			      NULL,
-			      XML_PARSE_NONET);
+			      XML_PARSE_NONET | XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
   if (!doc) {
     //    cout << xml << endl;
     throw String("generateXML(): internal error");

/cvs/cluster/conga/ricci/include/Network.h,v --> standard output revision 1.1.4.1

- renamed from ricci/include/Network.h +54 -0

54 lines not on this page · raw message

ricci/include/Socket.h +15 -13
@@ -34,14 +34,11 @@
 // provide external locking
 
 
-std::vector<String> name2IP(const String& hostname);
-
-
 class Socket
 {
  public:
   Socket(const Socket&);
-  Socket& operator= (const Socket&);
+  virtual Socket& operator= (const Socket&);
   virtual ~Socket();
   
   virtual bool operator== (const Socket&);
@@ -73,24 +70,29 @@
  public:
   ClientSocket();
   ClientSocket(const String& sock_path);  // UNIX socket
-  ClientSocket(const String& hostname, unsigned short port);  // TCP socket
+  ClientSocket(const String& hostname, unsigned short port,
+	       unsigned int timeout_ms=0  /*  0 - standard blocking behavior
+					     >0 - timeout
+					  */ );  // TCP socket
   ClientSocket(const ClientSocket&);
-  ClientSocket& operator= (const ClientSocket&);
+  virtual ClientSocket& operator= (const ClientSocket&);
   virtual ~ClientSocket();
   
-  String recv();
-  String send(const String& msg);  // return what is left to send
+  virtual String recv();
+  virtual String recv(int timeout);
+  virtual String send(const String& msg);  // return what is left to send
+  virtual String send(const String& msg, int timeout);
   
-  void ready(bool& recv, bool& send, int timeout);
+  virtual void ready(bool& recv, bool& send, int timeout);
   
   virtual bool server() { return false; }
   
   virtual bool connected_to(const String& hostname);
   
  protected:
-  unsigned int _addr;
+  u_int32_t _addr;  // address in network byte order 
   
-  ClientSocket(int sock, unsigned int addr=0);  // takes ownership of sock
+  ClientSocket(int sock, u_int32_t addr=0);  // takes ownership of sock
   friend class ServerSocket;
 };  // ClientSocket
 
@@ -101,12 +103,12 @@
   ServerSocket(const String& sock_path); // UNIX socket
   ServerSocket(unsigned short port); // TCP socket
   ServerSocket(const ServerSocket&);
-  ServerSocket& operator= (const ServerSocket&);
+  virtual ServerSocket& operator= (const ServerSocket&);
   virtual ~ServerSocket();
   
   ClientSocket accept();
   
-  bool ready(int timeout);
+  virtual bool ready(int timeout);
   
   virtual bool server() { return true; }
   
ricci/modules/cluster/clumon/src/daemon/Monitor.cpp +2 -1
@@ -26,6 +26,7 @@
 #include "Logger.h"
 #include "Time.h"
 #include "utils.h"
+#include "Network.h"
 
 #include <sys/poll.h>
 #include <sys/sysinfo.h>
@@ -584,7 +585,7 @@
        iter != nodenames.end();
        iter++) {
     const String& nodename = *iter;
-    vector<String> ips = name2IP(nodename);
+    vector<String> ips = Network::name2IP(nodename);
     for (vector<String>::iterator iter_ip = ips.begin();
 	 iter_ip != ips.end();
 	 iter_ip++) {
ricci/modules/cluster/clumon/src/daemon/Monitor.h +1 -1
@@ -49,7 +49,7 @@
 			   const String& msg);
   
  protected:
-  void run();
+  virtual void run();
  private:
   
   Mutex _mutex; // _cluster and _cache
ricci/ricci/Ricci.cpp +2 -17
@@ -31,13 +31,13 @@
 #include "Time.h"
 #include "XML_tags.h"
 #include "File.h"
+#include "Network.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <dirent.h>
-#include <netdb.h>
 
 
 #include <fstream>
@@ -45,7 +45,6 @@
 
 
 static bool dom0();
-static String hostname();
 static pair<String, String> clusterinfo();
 static String os_release();
 
@@ -71,7 +70,7 @@
     header.set_attr("authenticated", "false");
   
   if (full) {
-    String name = hostname();
+    String name = Network::localhost();
     if (name.size())
       header.set_attr("hostname", name);
     
@@ -459,20 +458,6 @@
 
 
 
-
-String 
-hostname()
-{
-  char name[1024];
-  if (gethostname(name, sizeof(name)))
-    return "";
-  struct hostent *ent = gethostbyname(name);
-  if (ent)
-    return String(ent->h_name);
-  else
-    return name;
-}
-
 pair<String, String> 
 clusterinfo()
 {

/cvs/cluster/conga/ricci/test_suite/SSLClient_send_to_ricci,v --> standard output revision 1.1.4.1

- renamed from ricci/test_suite/SSLClient_send_to_ricci +70 -0

70 lines not on this page · raw message