Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: crm by andrew from 
      ([email protected])
   2. Linux-HA CVS: crm by andrew from 
      ([email protected])
   3. Linux-HA CVS: crm by andrew from 
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Mon, 23 Jan 2006 07:59:42 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : crm

Dir     : linux-ha/crm/cib


Modified Files:
        callbacks.c 


Log Message:
Fix a memory leak

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -3 -r1.97 -r1.98
--- callbacks.c 20 Jan 2006 15:22:50 -0000      1.97
+++ callbacks.c 23 Jan 2006 14:59:41 -0000      1.98
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.97 2006/01/20 15:22:50 andrew Exp $ */
+/* $Id: callbacks.c,v 1.98 2006/01/23 14:59:41 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -667,25 +667,27 @@
                
                crm_debug_3("Sending callback to request originator");
                if(client_obj != NULL) {
+                       int local_rc = cib_ok;
+                       const char *client_id = client_obj->callback_id;
                        crm_debug_2("Sending %ssync response to %s %s",
                                  (call_options & cib_sync_call)?"":"an a-",
                                  client_obj->id,
                                  from_peer?"(originator of delegated 
request)":"");
 
                        if(call_options & cib_sync_call) {
-                               send_via_callback_channel(
-                                       client_reply, client_obj->id);
+                               client_id = client_obj->id;
+                       }
+                       local_rc = send_via_callback_channel(
+                               client_reply, client_id);
 
-                       } else {
-                               send_via_callback_channel(
-                                       client_reply, client_obj->callback_id);
+                       if(rc == cib_ok) {
+                               client_reply = NULL;
                        }
                        
-               } else {
-                       crm_warn("Client %s may have left us",
-                                crm_str(client_id));
-                       crm_msg_del(client_reply);
-               }
+               } 
+
+               crm_msg_del(client_reply);
+
                if(local_rc != cib_ok) {
                        crm_warn("%sSync reply failed: %s",
                                 (call_options & cib_sync_call)?"":"A-",
@@ -917,10 +919,15 @@
        if((call_options & cib_discard_reply)
           && cib_server_ops[call_type].modifies_cib == FALSE) {
                crm_debug_3("No reply needed for call %s", call_id);
+
+               free_xml(input_fragment);
+               free_xml(output);
                return rc;
                
        } else if(reply == NULL) {
                crm_debug("No reply possible for call %s", call_id);
+               free_xml(input_fragment);
+               free_xml(output);
                return rc;
        }
 




------------------------------

Message: 2
Date: Mon, 23 Jan 2006 09:07:03 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : crm

Dir     : linux-ha/crm/admin


Modified Files:
        xml_diff.c 


Log Message:
Catch memory leaks if they creep into the code

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/admin/xml_diff.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- xml_diff.c  9 Jan 2006 19:24:51 -0000       1.6
+++ xml_diff.c  23 Jan 2006 16:07:02 -0000      1.7
@@ -1,4 +1,4 @@
-/* $Id: xml_diff.c,v 1.6 2006/01/09 19:24:51 andrew Exp $ */
+/* $Id: xml_diff.c,v 1.7 2006/01/23 16:07:02 andrew Exp $ */
 
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -163,6 +163,8 @@
                usage(crm_system_name, LSB_EXIT_GENERIC);
        }
 
+       crm_zero_mem_stats(NULL);
+       
        if(raw_1) {
                object_1 = string2xml(xml_file_1);
 
@@ -221,6 +223,12 @@
                crm_free(buffer);
        }
 
+       free_xml(object_1);
+       free_xml(object_2);
+       free_xml(output);
+
+       crm_mem_stats(NULL);
+       
        if(apply == FALSE && output != NULL) {
                return 1;
        }




------------------------------

Message: 3
Date: Mon, 23 Jan 2006 09:19:07 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : crm

Dir     : linux-ha/crm/cib


Modified Files:
        callbacks.c notify.c 


Log Message:
Observe cib_inhibit_notify correctly

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -3 -r1.98 -r1.99
--- callbacks.c 23 Jan 2006 14:59:41 -0000      1.98
+++ callbacks.c 23 Jan 2006 16:19:06 -0000      1.99
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.98 2006/01/23 14:59:41 andrew Exp $ */
+/* $Id: callbacks.c,v 1.99 2006/01/23 16:19:06 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -869,8 +869,12 @@
                        do_id_check(input, NULL);
                }
        }
-       
-       if(cib_server_ops[call_type].modifies_cib) {
+
+       if(cib_server_ops[call_type].modifies_cib == FALSE) {
+       } else if(call_options & cib_inhibit_notify) {
+               crm_debug_3("Inhibiting notify.");
+
+       } else {
                cib_pre_notify(
                        call_options, op,
                        get_object_root(section, current_cib), input);
@@ -904,12 +908,17 @@
                                
                        }
                }
-               
-               cib_post_notify(call_options, op, input, rc, the_cib);
-               cib_diff_notify(call_options, op, input, rc, local_diff);
-               log_xml_diff(rc==cib_ok?cib_diff_loglevel:cib_diff_loglevel-1,
-                            local_diff, "cib:diff");
 
+               if(call_options & cib_inhibit_notify) {
+                       crm_debug_2("Inhibiting notify.");
+
+               } else {
+                       cib_post_notify(call_options, op, input, rc, the_cib);
+                       cib_diff_notify(call_options, op, input, rc, 
local_diff);
+               }
+               log_xml_diff(rc==cib_ok?cib_diff_loglevel:cib_diff_loglevel-1,
+                            local_diff, "cib:diff");
+               
        } else if(result_cib != NULL) {
                crm_err("%s call modified the CIB", op);
                free_xml(result_cib);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/notify.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- notify.c    11 Jan 2006 19:50:34 -0000      1.34
+++ notify.c    23 Jan 2006 16:19:07 -0000      1.35
@@ -1,4 +1,4 @@
-/* $Id: notify.c,v 1.34 2006/01/11 19:50:34 andrew Exp $ */
+/* $Id: notify.c,v 1.35 2006/01/23 16:19:07 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -178,10 +178,6 @@
        HA_Message *update_msg = NULL;
        const char *type = NULL;
        const char *id = NULL;
-       if(options & cib_inhibit_notify) {
-               crm_debug_2("Inhibiting notify.");
-               return;
-       }       
 
        update_msg = ha_msg_new(6);
 
@@ -231,10 +227,6 @@
 cib_post_notify(int options, const char *op, crm_data_t *update,
                enum cib_errors result, crm_data_t *new_obj) 
 {
-       if(options & cib_inhibit_notify) {
-               crm_debug_2("Inhibiting notify.");
-               return;
-       }
        do_cib_notify(
                options, op, update, result, new_obj, T_CIB_UPDATE_CONFIRM);
 }
@@ -288,11 +280,6 @@
        const char *type = NULL;
        const char *id = NULL;
 
-       if(options & cib_inhibit_notify) {
-               crm_warn("Inhibiting notify.");
-               return;
-       }
-
        update_msg = ha_msg_new(8);
 
        if(result_data != NULL) {




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 26, Issue 51
********************************************

Reply via email to