From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10926 invoked by alias); 23 Mar 2009 18:41:33 -0000 Received: (qmail 10920 invoked by alias); 23 Mar 2009 18:41:32 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63,SPF_HELO_PASS X-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion.fedora.phx.redhat.com Subject: cluster: master - config: kill dead code To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: ab7cfa4fc10c5ec6a03b3c4cad7dc94a2dfbb047 X-Git-Newrev: 25ab811cdd1be2d1593405836719de5a06684d98 From: "Fabio M. Di Nitto" Message-Id: <20090323184112.DFC001201C2@lists.fedorahosted.org> Date: Mon, 23 Mar 2009 18:41:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00877.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=25ab811cdd1be2d1593405836719de5a06684d98 Commit: 25ab811cdd1be2d1593405836719de5a06684d98 Parent: ab7cfa4fc10c5ec6a03b3c4cad7dc94a2dfbb047 Author: Fabio M. Di Nitto AuthorDate: Mon Mar 23 19:38:56 2009 +0100 Committer: Fabio M. Di Nitto CommitterDate: Mon Mar 23 19:41:03 2009 +0100 config: kill dead code remove all EXPERIMENTAL code. Signed-off-by: Fabio M. Di Nitto --- config/libs/libccsconfdb/ccs.h | 4 -- config/libs/libccsconfdb/libccs.c | 71 ------------------------------------- 2 files changed, 0 insertions(+), 75 deletions(-) diff --git a/config/libs/libccsconfdb/ccs.h b/config/libs/libccsconfdb/ccs.h index b85a69b..bf2c8e1 100644 --- a/config/libs/libccsconfdb/ccs.h +++ b/config/libs/libccsconfdb/ccs.h @@ -17,8 +17,4 @@ void ccs_read_logging(int fd, char *name, int *debug, int *mode, int *logfile_priority, char *logfile); extern int fullxpath; -#ifdef EXPERIMENTAL_BUILD -extern int ccs_persistent_conn; -#endif - #endif /* __CCS_DOT_H__ */ diff --git a/config/libs/libccsconfdb/libccs.c b/config/libs/libccsconfdb/libccs.c index 0eb33de..c24bead 100644 --- a/config/libs/libccsconfdb/libccs.c +++ b/config/libs/libccsconfdb/libccs.c @@ -6,23 +6,10 @@ #include #include #include -#ifdef EXPERIMENTAL_BUILD -#include -#endif #include "ccs.h" #include "ccs_internal.h" -#ifdef EXPERIMENTAL_BUILD -#ifndef CCS_HANDLE_TIMEOUT -#define CCS_HANDLE_TIMEOUT 60 /* 60 seconds */ -#endif -#endif - -#ifdef EXPERIMENTAL_BUILD -int ccs_persistent_conn = 0; -#endif - /* Callbacks are not supported - we will use them to update fullxml doc/ctx */ static confdb_callbacks_t callbacks = { }; @@ -236,9 +223,6 @@ static hdb_handle_t create_ccs_handle(confdb_handle_t handle, int ccs_handle, hdb_handle_t libccs_handle = 0, connection_handle = 0; char buf[128]; int config_version = 0; -#ifdef EXPERIMENTAL_BUILD - time_t current_time; -#endif libccs_handle = find_libccs_handle(handle); if (libccs_handle == -1) @@ -283,21 +267,6 @@ static hdb_handle_t create_ccs_handle(confdb_handle_t handle, int ccs_handle, errno = ENOMEM; return -1; } -#ifdef EXPERIMENTAL_BUILD - if (ccs_persistent_conn) - return connection_handle; - - memset(buf, 0, sizeof(buf)); - time(¤t_time); - memcpy(buf, ¤t_time, sizeof(time_t)); - if (confdb_key_create - (handle, connection_handle, "last_access", strlen("last_access"), - buf, sizeof(time_t)) != CS_OK) { - destroy_ccs_handle(handle, connection_handle); - errno = ENOMEM; - return -1; - } -#endif return connection_handle; } @@ -435,42 +404,6 @@ void reset_iterator(confdb_handle_t handle, hdb_handle_t connection_handle) return; } -#ifdef EXPERIMENTAL_BUILD -static int clean_stalled_ccs_handles(confdb_handle_t handle) -{ - int datalen = 0; - hdb_handle_t libccs_handle = 0, connection_handle = 0; - time_t current_time, stored_time; - - libccs_handle = find_libccs_handle(handle); - if (libccs_handle == -1) - return -1; - - if (confdb_object_find_start(handle, libccs_handle) != CS_OK) { - errno = ENOMEM; - return -1; - } - - time(¤t_time); - - while (confdb_object_find - (handle, libccs_handle, "connection", strlen("connection"), - &connection_handle) == CS_OK) { - if (confdb_key_get - (handle, connection_handle, "last_access", - strlen("last_access"), &stored_time, - &datalen) == CS_OK) { - if ((current_time - stored_time) > CCS_HANDLE_TIMEOUT) - destroy_ccs_handle(handle, connection_handle); - } - } - - confdb_object_find_destroy(handle, libccs_handle); - - return 0; -} -#endif - static int check_cluster_name(int ccs_handle, const char *cluster_name) { confdb_handle_t handle = 0; @@ -588,10 +521,6 @@ int ccs_connect(void) if (handle == -1) return handle; -#ifdef EXPERIMENTAL_BUILD - clean_stalled_ccs_handles(handle); -#endif - get_ccs_handle(handle, &ccs_handle, fullxpath); if (ccs_handle < 0) goto fail;