I checked the commands in src/rivetcmds/rivetCore.c and all of them
depend on a valid request_rec object pointer with a few exceptions
Rivet_AbortPageCmd, Rivet_AbortCodeCmd ( implementing
::rivet::abort_page, ::rivet::abort_code) need the pointer to the
globals because they handle the abort_code field but don't need the
request_rec object pointer
Rivet_LogErrorCmd correctly checks for globals->r in order to pass the
server_rec argument to ap_log_error.
Rivet_InspectCmd (implementing ::rivet::inspect) returns an empty string
if globals->r is NULL.
I think all the commands handling a request_rec object should check for
a NULL object pointer and return a Tcl error in case they are called
from outside a request processing. This includes ::rivet::inspect.
New tests must be added to check for future regressions.
With this new behaviour a programmer shouldn't be snared into the issue
#56290 because they get with the Tcl error, a reason for it and a chance
to catch the condition.
I propose to extend inspect so that also also some of the server_rec
object properties can be read from Tcl scripts.
-- Massimo
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]