libwww-perl/WWW-Mechanize — pull request #14 by creaktive (2013-03-01 14:53:19+00:00)
Title: ensure /quit_server calls for full HTTP/1.1 keepalive compatibility

The `t/local/encoding.t` & `t/local/referer.t` tests are *potentially* deadlockable:

PERL5OPT=-MLWP::Protocol::Net::Curl=http_version,2 prove -lv t/local/encoding.t t/local/referer.t

Here, the testing server waits for the client to close connection, and vice-versa. The client *could* be forced to use a non-keepalive connection, which solves the deadlock:

PERL5OPT=-MLWP::Protocol::Net::Curl=http_version,1 prove -lv t/local/encoding.t t/local/referer.t

Both tests could also include an explicit `undef $agent`. The attached code uses the already-available `/quit_server` URI to do the things in a safest way.