[LON-CAPA-cvs] cvs: loncom / LondTransaction.pm loncnew

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 16 Jun 2005 22:33:47 -0000


albertel		Thu Jun 16 18:33:47 2005 EDT

  Modified files:              
    /loncom	loncnew LondTransaction.pm 
  Log:
  - BUg#4128
  
  
Index: loncom/loncnew
diff -u loncom/loncnew:1.70 loncom/loncnew:1.71
--- loncom/loncnew:1.70	Wed Jun  8 22:38:03 2005
+++ loncom/loncnew	Thu Jun 16 18:33:45 2005
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # lonc maintains the connections to remote computers
 #
-# $Id: loncnew,v 1.70 2005/06/09 02:38:03 albertel Exp $
+# $Id: loncnew,v 1.71 2005/06/16 22:33:45 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -677,9 +677,9 @@
 
     if ($ConnectionRetriesLeft > 0) {
 	Log("WARNING", "Failing transaction "
-	    .$transaction->getRequest());
+	    .$transaction->getLoggableRequest());
     }
-    Debug(1, "Failing transaction: ".$transaction->getRequest());
+    Debug(1, "Failing transaction: ".$transaction->getLoggableRequest());
     if (!$transaction->isDeferred()) { # If the transaction is deferred we'll get to it.
 	my $client  = $transaction->getClient();
 	Debug(1," Replying con_lost to ".$transaction->getRequest());
Index: loncom/LondTransaction.pm
diff -u loncom/LondTransaction.pm:1.7 loncom/LondTransaction.pm:1.8
--- loncom/LondTransaction.pm:1.7	Tue Jun  1 06:06:52 2004
+++ loncom/LondTransaction.pm	Thu Jun 16 18:33:45 2005
@@ -1,7 +1,7 @@
 #   This module defines and implements a class that represents
 #   a connection to a lond daemon.
 #
-# $Id: LondTransaction.pm,v 1.7 2004/06/01 10:06:52 foxr Exp $
+# $Id: LondTransaction.pm,v 1.8 2005/06/16 22:33:45 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -300,10 +300,28 @@
   Returns the remaining request text.
 
 =cut
+
 sub getRequest {
     my $self = shift;
     return $self->{request};
 }
 
+=pod
+
+=item getLoggableRequest
+
+   Use this top get what the request is when you don't want to spew
+   sensitive data into logs
+
+=cut
+
+sub getLoggableRequest {
+    my $self = shift;
+    my ($cmd,$subcmd)=split(':',$self->{request});
+    if ($cmd eq 'encrypt') {
+	return "$cmd:$subcmd";
+    }
+    return $cmd;
+}
 
 1;