Seed the RNG in each FastCGI child process.
authorFlorian Ragwitz <rafl@debian.org>
Tue, 3 Feb 2009 10:32:45 +0000 (10:32 +0000)
committerFlorian Ragwitz <rafl@debian.org>
Tue, 3 Feb 2009 10:32:45 +0000 (10:32 +0000)
commitcfd311586431cc08d3e5d4aa8edc3e8ce4515f43
tree3dde6824202776b6aa99ec43e55e9172b4d9624b
parenta541abb8dedb308886532aacf6abff3b958fdd49
Seed the RNG in each FastCGI child process.

From: Andrew Rodland <arodland@comcast.net>
Message-Id: <200902021709.21737.arodland@comcast.net>

Due to the way FastCGI does its business, when running as an "external"
FastCGI, the perl interpreter and the Catalyst app are initialized before the
FCGI process manager does its forking. Since modern versions of Perl seed
rand() "eagerly" on startup, this leads to all of the FastCGI children
inheriting the same RNG state, and very nonrandom behavior (such as CAPTCHAs
that appear to get "stuck").
lib/Catalyst/Engine/FastCGI.pm