Unwanted behaviour on Zend\Http\Client eq not thread safe
Hi,
We are using our application with around 25 workers (with beanstalkd and 25 listening proccesses). Most of the time we use the Client object to retrieve external content. And we do mime type checks which uses the headers.
Some of the use cases have setStream used.
And some times it will occur that the stream which is set by Client is the same filename used by another proccesses Client object. So we get a json mime type for an xml file by example.
It seems to go wrong on line 691 in \Zend\Http\Client object where tempnam is used. And as we can read from the documentation it is not really save to use.
http://php.net/manual/en/function.tempnam.php#98232
I suppose we should be using setStream with an own unique filename for each process to be safe. But that would be a workaround on the issue.
Thanks!
You could define a different config streamtmpdir for each process
We've tried that just now. But we keep getting an content type thats not correct.
This repository has been closed and moved to laminas/laminas-http; a new issue has been opened at https://github.com/laminas/laminas-http/issues/23.