From 9b6cff9fb09a6a49d75439b03201f8e6c8995e22 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Thu, 24 Aug 2006 08:18:19 +0000 Subject: [PATCH] - add test for crash when detaching request from pool in callbacks --- package2.xml | 2 ++ tests/HttpRequestPool_006.phpt | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/HttpRequestPool_006.phpt diff --git a/package2.xml b/package2.xml index 5773d4d..406cada 100644 --- a/package2.xml +++ b/package2.xml @@ -42,6 +42,7 @@ support. Parallel requests are available for PHP 5 and greater. * Fixed issues with inheritance and cloning of HttpDeflateStream, HttpInflateStream and HttpMessage (Extending classes lose default properties on instantiation; Complex members ignored during cloning) * Fixed suppression of nested exceptions in e.g. HttpRequestPool::send() +* Fixed crash on detaching requests from pool in request event callbacks ]]> @@ -197,6 +198,7 @@ support. Parallel requests are available for PHP 5 and greater. + diff --git a/tests/HttpRequestPool_006.phpt b/tests/HttpRequestPool_006.phpt new file mode 100644 index 0000000..9d788ad --- /dev/null +++ b/tests/HttpRequestPool_006.phpt @@ -0,0 +1,32 @@ +--TEST-- +HttpRequestPool detaching in callbacks +--SKIPIF-- + +--FILE-- +detach($this); + } +} +class r2 extends HttpRequest { + function onFinish() { + $GLOBALS['p']->detach($this); + } +} +$p = new HttpRequestPool(new r1("at.php.net"), new r2("de.php.net")); +$p->send(); +var_dump($p->getAttachedRequests()); +echo "Done\n"; +?> +--EXPECTF-- +%sTEST +array(0) { +} +Done -- 2.30.2