Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

JHttpTransportSocket timeout #1142

Closed
rredpoppy opened this Issue Apr 10, 2012 · 4 comments

Comments

Projects
None yet
3 participants

JHttp calls from the request method do not set a timeout, thus leaving the timeout with the default value. In JHttpTransportSocket, this implicit timeout is null and it's used in the connect method.

For some reason, somewhere in this file, I get a connect timeout error. Curl wrapper seems to work fine, though. The error is a fatal exception 'Connection timeout'

Example code that throws the exception:

        jimport('joomla.http');
        $transport = null;
        $transportWrappers = array('JHttpTransportCurl', 'JHttpTransportStream', 
            'JHttpTransportSocket');
        $options = new JRegistry();
        while (!$transport && $transportWrappers)
            try{
                $wrapper = array_shift($transportWrappers);
                $transport = new $wrapper($options);                
            }
            catch (Exception $e){
                continue;
            }
        $http = new JHttp($options, $transport);
        $getData = array('something'=>'else');
        $url = 'http://www.exmple.com';
        $response = $http->get($url, $getData);
Contributor

elinw commented May 28, 2012

Are you using ssl?
I think https://github.com/joomla/joomla-platform/blob/staging/libraries/joomla/http/transport/socket.php#L243 should be handling but there seems to be a php bug if it is ssl
https://bugs.php.net/bug.php?id=41631
Can you check default_socket_timeout in your environment?

Contributor

elinw commented Nov 28, 2012

Any update on this?

Contributor

eddieajau commented Apr 5, 2013

I'm sorry but we aren't accepting issues for this repository any more. Please see http://developer.joomla.org/cms/report-an-issue.html for how to report and issue for the CMS Platform.

@eddieajau eddieajau closed this Apr 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment