[LON-CAPA-cvs] cvs: loncom / lond lonsql

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 11 May 2006 17:53:23 -0000


albertel		Thu May 11 13:53:23 2006 EDT

  Modified files:              
    /loncom	lond lonsql 
  Log:
  - removing some code duplication
  
  
Index: loncom/lond
diff -u loncom/lond:1.324 loncom/lond:1.325
--- loncom/lond:1.324	Wed Mar 29 14:56:10 2006
+++ loncom/lond	Thu May 11 13:53:22 2006
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.324 2006/03/29 19:56:10 raeburn Exp $
+# $Id: lond,v 1.325 2006/05/11 17:53:22 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -31,6 +31,7 @@
 
 use strict;
 use lib '/home/httpd/lib/perl/';
+use LONCAPA;
 use LONCAPA::Configuration;
 
 use IO::Socket;
@@ -61,7 +62,7 @@
 my $lastlog='';
 my $lond_max_wait_time = 13;
 
-my $VERSION='$Revision: 1.324 $'; #' stupid emacs
+my $VERSION='$Revision: 1.325 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -5177,22 +5178,6 @@
     $0='lond: '.$what.' '.$local;
 }
 
-# -------------------------------------------------------- Escape Special Chars
-
-sub escape {
-    my $str=shift;
-    $str =~ s/(\W)/"%".unpack('H2',$1)/eg;
-    return $str;
-}
-
-# ----------------------------------------------------- Un-Escape Special Chars
-
-sub unescape {
-    my $str=shift;
-    $str =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
-    return $str;
-}
-
 # ----------------------------------------------------------- Send USR1 to lonc
 
 sub reconlonc {
Index: loncom/lonsql
diff -u loncom/lonsql:1.76 loncom/lonsql:1.77
--- loncom/lonsql:1.76	Fri Feb 10 04:51:27 2006
+++ loncom/lonsql	Thu May 11 13:53:22 2006
@@ -3,7 +3,7 @@
 # The LearningOnline Network
 # lonsql - LON TCP-MySQL-Server Daemon for handling database requests.
 #
-# $Id: lonsql,v 1.76 2006/02/10 09:51:27 albertel Exp $
+# $Id: lonsql,v 1.77 2006/05/11 17:53:22 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -102,6 +102,7 @@
 use strict;
 
 use lib '/home/httpd/lib/perl/';
+use LONCAPA;
 use LONCAPA::Configuration;
 use LONCAPA::lonmetadata();
 
@@ -728,52 +729,6 @@
 
 =pod
 
-=item &escape
-
-Escape special characters in a string.
-
-Inputs: string to escape
-
-Returns: The input string with special characters escaped.
-
-=cut
-
-########################################################
-########################################################
-sub escape {
-    my $str=shift;
-    $str =~ s/(\W)/"%".unpack('H2',$1)/eg;
-    return $str;
-}
-
-########################################################
-########################################################
-
-=pod
-
-=item &unescape
-
-Unescape special characters in a string.
-
-Inputs: string to unescape
-
-Returns: The input string with special characters unescaped.
-
-=cut
-
-########################################################
-########################################################
-sub unescape {
-    my $str=shift;
-    $str =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
-    return $str;
-}
-
-########################################################
-########################################################
-
-=pod
-
 =item &ishome
 
 Determine if the current machine is the home server for a user.