From: Chris W. <la...@us...> - 2004-09-28 16:08:26
|
Update of /cvsroot/openinteract/OpenInteract In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9101 Modified Files: OpenInteract.pm Log Message: OI-6: fix bad variable declaration and make the code a little clearer Index: OpenInteract.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract/OpenInteract.pm,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** OpenInteract.pm 30 May 2004 15:13:49 -0000 1.53 --- OpenInteract.pm 28 Sep 2004 16:08:14 -0000 1.54 *************** *** 465,473 **** sub send_static_file { my ( $class, $R ) = @_; ! my $fh = $R->{page}{send_file}; my ( $file_size ); # File is a handle... ! if ( ref $fh ) { my $default_type = 'application/octet-stream'; unless ( $R->{page}{content_type} ) { --- 465,476 ---- sub send_static_file { my ( $class, $R ) = @_; ! my $file_spec = $R->{page}{send_file}; my ( $file_size ); + my ( $fh ); # File is a handle... ! ! if ( ref $file_spec ) { ! $fh = $file_spec; my $default_type = 'application/octet-stream'; unless ( $R->{page}{content_type} ) { *************** *** 484,496 **** # File is a filename... else { ! my $fh = Apache->gensym; ! eval { open( $fh, $R->{page}{send_file} ) || die $!; }; if ( $@ ) { ! $R->scrib( 0, "Cannot open static file from filesystem ($R->{page}{send_file}): $@" ); return NOT_FOUND; } $file_size = $R->{page}{send_file_size} ! || (stat $R->{page}{send_file})[7]; ! $R->DEBUG && $R->scrib( 1, "Sending file ($R->{page}{send_file}) of size", "($file_size) and type", "($R->{page}{content_type})" ); --- 487,499 ---- # File is a filename... else { ! $fh = Apache->gensym; ! eval { open( $fh, $file_spec ) || die $! }; if ( $@ ) { ! $R->scrib( 0, "Cannot open static file from filesystem ($file_spec): $@" ); return NOT_FOUND; } $file_size = $R->{page}{send_file_size} ! || (stat $file_spec)[7]; ! $R->DEBUG && $R->scrib( 1, "Sending file ($file_spec) of size", "($file_size) and type", "($R->{page}{content_type})" ); |