perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Johnson" <>
Subject Problem with PerlCleanupHandler
Date Thu, 02 Nov 2006 22:44:18 GMT
Hi, I'm registering a PerlCleanupHandler method in my mod_perl cgi handler.

$r->set_handlers( PerlCleanupHandler => [ &send_to_client ]);

My goal is to have this service take an xml message, do some processing on
it and reply with a confirm xml message.  Afterward I need to POST a
completely new message to the client unrelated to that connection but
initiated because of it.  I don't want to have to write an external program
(run via cron) to push these messages.  Nor do I have any queue software
installed.  I simply want to register the Cleanup method to do the work
after the response has been sent back to the client and the connection is
closed.  In testing this out, it works pefectly when testing with curl using
a simple GET.  It sends me a response almost immediately, but if i watch the
logs, it processes the cleanuphandler method like it should, after i already
received the response (testing this using a sleep 5; in the top of sub
send_to_client).  However, as soon as I change my request to a POST, it is
blocking.  The request hangs and doesn't send the response to the client
until after the Cleanup method has completed.  Is this proper behaviour?  Is
there a way around this?


Steve Johnson

View raw message