Issues

ZF-9006: Zend_Http_Client_Adapter_Socket Read timeout not work in In some cases

Issue Type: Bug Created: 2010-01-29T02:09:46.000+0000 Last Updated: 2012-11-20T21:37:40.000+0000 Status: Open Fix version(s): Reporter: Ken Chou (kenchou77) Assignee: None Tags: - Zend_Http_Client

Related issues: Attachments:

Description

I have a case that timeout not work. I found this should happen during the reading header. There is no check timeout. And after add check, the issue is resolved.

<pre class="highlight">
    public function read() {
...
        while (($line = @fgets($this->socket)) !== false) {
            //<-- there is no check 
            $gotStatus = $gotStatus || (strpos($line, 'HTTP') !== false);
            if ($gotStatus) {
                $response .= $line;
                if (rtrim($line) === '') break;
            }
        }

        $this->_checkSocketReadTimeout(); //<-- check timeout here

-- patch ---

@@ -319,6 +319,7 @@

<pre class="highlight">
         $stream = !empty($this->config['stream']);
 
         while (($line = @fgets($this->socket)) !== false) {
+            $this->_checkSocketReadTimeout();
             $gotStatus = $gotStatus || (strpos($line, 'HTTP') !== false);
             if ($gotStatus) {
                 $response .= $line;

Comments

No comments to display

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts