[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 22 Apr 2005 20:50:07 -0000


albertel		Fri Apr 22 16:50:07 2005 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - check conten-length before trying to read it
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.259 loncom/interface/loncommon.pm:1.260
--- loncom/interface/loncommon.pm:1.259	Thu Apr  7 04:15:41 2005
+++ loncom/interface/loncommon.pm	Fri Apr 22 16:50:07 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.259 2005/04/07 08:15:41 albertel Exp $
+# $Id: loncommon.pm,v 1.260 2005/04/22 20:50:07 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2975,8 +2975,9 @@
     my $r=shift;
 
     my $buffer;
-    
-    $r->read($buffer,$r->header_in('Content-length'),0);
+    if ($r->header_in('Content-length')) {
+	$r->read($buffer,$r->header_in('Content-length'),0);
+    }
     unless ($buffer=~/^(\-+\w+)\s+Content\-Disposition\:\s*form\-data/si) {
 	my @pairs=split(/&/,$buffer);
 	my $pair;