Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

JHttpTransportSocket timeout #1142

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

JHttpTransportSocket timeout #1142

rredpoppy opened this issue Apr 10, 2012 · 4 comments

Comments

@rredpoppy
Copy link

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'

@rredpoppy
Copy link
Author

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);

@elinw
Copy link
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?

@elinw
Copy link
Contributor

elinw commented Nov 28, 2012

Any update on this?

@eddieajau
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants