[interchange-cvs] interchange - edl modified lib/Vend/Server.pm
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Mon Jul 8 18:45:00 2002
User: edl
Date: 2002-07-08 22:44:26 GMT
Modified: lib/Vend Tag: STABLE_4_8-branch Server.pm
Log:
Fixed a bug which occurs when doing a Post + query-string with TolerateGet;
parse_post gets called twice in that situation and was blowing away values =
read
on the first pass during the second pass...
Revision Changes Path
No revision
No revision
2.0.2.5 +11 -7 interchange/lib/Vend/Server.pm
rev 2.0.2.5, prev_rev 2.0.2.4
Index: Server.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Server.pm,v
retrieving revision 2.0.2.4
retrieving revision 2.0.2.5
diff -u -r2.0.2.4 -r2.0.2.5
--- Server.pm 27 Jun 2002 22:38:24 -0000 2.0.2.4
+++ Server.pm 8 Jul 2002 22:44:26 -0000 2.0.2.5
@@ -1,6 +1,6 @@
# Vend::Server - Listen for Interchange CGI requests as a background server
#
-# $Id: Server.pm,v 2.0.2.4 2002/06/27 22:38:24 jon Exp $
+# $Id: Server.pm,v 2.0.2.5 2002/07/08 22:44:26 edl Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -25,7 +25,7 @@
package Vend::Server;
=20
use vars qw($VERSION);
-$VERSION =3D substr(q$Revision: 2.0.2.4 $, 10);
+$VERSION =3D substr(q$Revision: 2.0.2.5 $, 10);
=20
use POSIX qw(setsid strftime);
use Vend::Util;
@@ -189,9 +189,13 @@
#::logDebug("CGI::query_string=3D" . $CGI::query_string);
#::logDebug("entity=3D" . ${$h->{entity}});
if ("\U$CGI::request_method" eq 'POST') {
- parse_post(\$CGI::query_string)
- if $Global::TolerateGet;
- parse_post($h->{entity});
+ if ($Global::TolerateGet) {
+ parse_post(\$CGI::query_string);
+ parse_post($h->{entity}, 1);
+ }
+ else {
+ parse_post($h->{entity});
+ }
}
else {
parse_post(\$CGI::query_string);
@@ -215,9 +219,9 @@
}
=20
sub parse_post {
- my $sref =3D shift;
+ my ($sref, $preserve) =3D @_;
my(@pairs, $pair, $key, $value);
- undef %CGI::values;
+ undef %CGI::values unless $preserve;
return unless length $$sref;
if ($CGI::content_type =3D~ /^multipart/i) {
return parse_multipart($sref) if $CGI::useragent !~ /MSIE\s+5/i;