ZF-9265: Unit tests for Zend_Http_Client appear to hang on Socket tests


Unit tests for Zend_Http_Client appear to hang on Socket tests

Dynamic host: Apache 2.2.9-10 / Linux Debian Lenny PHP: 5.2.6.dfsg.1-1

Tracked it down to the calls to stream_copy_to_stream. Replacing the stream_copy_to_stream with an equivalent fread+fwrite appears to fix it.


Patch contains - Replaced stream_copy_to_stream with matching fread/fwrite. - minor code refactoring to reduce some of the duplicate code - adjusted some unit tests to stop errors from dumping binary blobs to the command line.

The patch seems to just read everything into memory - which kind of defies the purpose of using streams, which is not to load the whole big file into memory.

Please also note what exactly test you are running that hangs and with which settings. I also see you are running very old PHP - please test with newer 5.2 or 5.3.

Hi Michael,

Are you sure that this can be reproduced by simply running the Socket tests and not with the Proxy adapter tests?

I was able to reproduce this only with the Proxy adapter, and that was fixed by Stas in CS-21792.

If you are able to reproduce this after this fix, please provide the info requested above. If not, please mark as resolved.

Most likely it is due to the age of my PHP.