Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[mv] bug in Server.pm (mv4.02)



******    message to minivend-users from "Bill Randle" <billr@exgate.tek.com>     ******


Mike/List,

I found a bug in parse_multipart() in Server.pm (line 207), but I'm not
sure how to solve it since the obvious fix fails with other errors.
The offending line of code is the call to interaction_error():
    unless ($CGI::post_input =~ s/^\s*$boundary\s+//) {
        return interaction_error("multipart/form-data sent incorrectly");
    }

The initial problem is that interaction_error lives in Error.pm. So, we do
the obvious fix:
	return ::interaction_error("multipart/form-data sent incorrectly");

This fixes the immediate problem, but then I get this in the global
error.log file:

204.119.40.90 - - [26/March/2000:14:50:45 -0800] -
/fairwaytrader/golf4.cgi/database/editclub.html Could not open error file : No
such file or directory
> to report this error: 204.119.40.90 - - [26/March/2000:14:50:45 -0800] -
/fairwaytrader/golf4.cgi/database/editclub.html Missing special page: interact
204.119.40.90 - - [26/March/2000:14:50:45 -0800] -
/fairwaytrader/golf4.cgi/database/editclub.html Runtime error: Can't call
method "respond" on an undefined value at ../../bin/minivend line 281.
>

The problem appears to be that parse_multipart(), which gets called from
parse_post(), which in turn gets called from map_cgi(), which is called
from new(), is called prior to ::dispatch() (which is in ~/bin/minivend).
So, what ends up happening is that interaction_error() calls ::response()
with the error string. In turn, response() calls $H->respond(). However,
because this is called outside the dispatch() routine $H is undefined,
hence the error "Can't call method "respond" on an undefined value at...".

I'll let Mike come up with the "proper" fix here. In the meantime, I've
replaced:
	return interaction_error("multipart/form-data sent incorrectly");
with:
	::logGlobal("multipart/form-data sent incorrectly");
	return;

in my local copy of Server.pm.

	-Bill Randle
	Tektronix, Inc.
	billr@exgate.tek.com

-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: