--- loncom/lonnet/perl/lonnet.pm 2007/04/20 21:48:09 1.871 +++ loncom/lonnet/perl/lonnet.pm 2007/05/02 22:00:02 1.872 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.871 2007/04/20 21:48:09 albertel Exp $ +# $Id: lonnet.pm,v 1.872 2007/05/02 22:00:02 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1065,7 +1065,10 @@ my $kicks=0; my $hits=0; sub make_key { my ($name,$id) = @_; - if (length($id) > 200) { $id=length($id).':'.&Digest::MD5::md5_hex($id); } + if (length($id) > 65 + && length(&escape($id)) > 200) { + $id=length($id).':'.&Digest::MD5::md5_hex($id); + } return &escape($name.':'.$id); } @@ -1112,7 +1115,9 @@ sub do_cache_new { $time=600; } if ($debug) { &Apache::lonnet::logthis("Setting $id to $value"); } - $memcache->set($id,$setvalue,$time); + if (!($memcache->set($id,$setvalue,$time))) { + &logthis("caching of id -> $id failed"); + } # need to make a copy of $value #&make_room($id,$value,$debug); return $value;