[BlueOnyx:16440] Re: 5208R - Login takes 300 Seconds and more

Michael Stauber mstauber at blueonyx.it
Tue Nov 11 10:19:27 -05 2014


Hi Dirk,

> Please add a timeout in 5208R for fetching the blueonyx news or add a switch to turn off the news.

Actually there is a timeout of 5 seconds for this particular purpose:

http://devel.blueonyx.it/trac/browser/BlueOnyx/5207R/platform/alpine.mod/ci/application/helpers/blueonyx_helper.php

565	function get_data($url) {
566	    $ch = curl_init();
567	    $timeout = 5;
568	    curl_setopt($ch,CURLOPT_URL,$url);
569	    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
570	    curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
571	    curl_setopt($ch, CURLOPT_USERAGENT, 'BlueLinQ/1.0');
572	    $error = curl_error($ch);
573	    $data = curl_exec($ch);
574	    if($data === false) {
575	        $data = $error;
576	    }
577	    curl_close($ch);
578	    return $data;
579	}

But it's pretty clear that it's not really catching every kind of
connection problems. I'll throw in a separate 'CURLOPT_TIMEOUT' as well,
which should fix it.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list