Annotation of embedaddon/php/ext/curl/tests/bug52827.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #52827 (curl_setopt with CURLOPT_STDERR erroneously increments the resource refcount)
                      3: --SKIPIF--
                      4: <?php
                      5: 
                      6: if (!extension_loaded('curl')) {
                      7:        exit("skip curl extension not loaded");
                      8: }
                      9: 
                     10: ?>
                     11: --FILE--
                     12: <?php
                     13: $s = fopen('php://temp/maxmemory=1024','wb+');
                     14: 
                     15: /* force conversion of inner stream to STDIO.
                     16:  * This is not necessary in Windows because the
                     17:  * cast to a FILE* handle in curl_setopt already
                     18:  * forces the conversion in that platform. The
                     19:  * reason for this conversion is that the memory
                     20:  * stream has an ugly but working mechanism to
                     21:  * prevent being double freed when it's encapsulated,
                     22:  * while STDIO streams don't. */
                     23: $i = 0;
                     24: while ($i++ < 5000) {
                     25: fwrite($s, str_repeat('a',1024));
                     26: }
                     27: $handle=curl_init('http://www.example.com');
                     28: curl_setopt($handle, CURLOPT_STDERR, $s);
                     29: 
                     30: echo "Done.";
                     31: --EXPECTF--
                     32: Done.

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>