Author: arkurth
Date: Thu Apr 26 16:22:50 2012
New Revision: 1330926

URL: http://svn.apache.org/viewvc?rev=1330926&view=rev
Log:
VCL-463
Fixed bug in DataStructure.pm which occurred if get_* was called with a null 
argument. It would cause process to crash.

Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm

Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=1330926&r1=1330925&r2=1330926&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm Thu Apr 26 
16:22:50 2012
@@ -739,8 +739,8 @@ sub _automethod : Automethod {
                $set_data = $args[0];
        }
        elsif ($mode =~ /set/) {
-               notify($ERRORS{'WARNING'}, 0, "data structure set function was 
called without an argument");
-               return;
+               notify($ERRORS{'WARNING'}, 0, "data structure $method_name 
function was called without an argument");
+               return sub { };
        }
        elsif ($mode =~ /get/ && defined $args[0] && !$args[0]) {
                $show_warnings = 0;
@@ -836,11 +836,11 @@ sub _automethod : Automethod {
                # Make sure the value was set in the hash
                my $check_value = eval $hash_path;
                if ($check_value eq $set_data) {
-                       #notify($ERRORS{'DEBUG'}, 0, "data structure updated: 
$hash_path\n$data_identifier = $set_data");
+                       notify($ERRORS{'DEBUG'}, 0, "data structure updated, 
hash path: $hash_path, data identifier: $data_identifier, data:\n" . 
format_data($set_data));
                        return sub {1;};
                }
                else {
-                       notify($ERRORS{'WARNING'}, 0, "data structure could not 
be updated: $data_identifier");
+                       notify($ERRORS{'WARNING'}, 0, "data structure could not 
be updated, hash path: $hash_path, data identifier: $data_identifier, data:\n" 
. format_data($set_data));
                        return sub {0;};
                }
        } ## end elsif ($mode =~ /set/)  [ if ($mode =~ /get/)


Reply via email to