hey, We are facing a problem with tiny_mc plugin where users seems to be inserting media/images by placing external urls which doesn't seem to respond for ever. As a result, all our httpd processes are waiting on those external network calls and affecting rest of the users. We have temporarily disabled tiny_mc and looking for ways to configure timeout either globally in roundcube or specifically for this plugin for ALL external http calls that roundcube makes. Any help is highly appreciated.
Thanks!
fyi - we are running : roundcube-0.6-81336 php-5.2.5-1 httpd-2.2.3-45
On Fri, Jul 6, 2012 at 3:09 PM, Krishna PMV krishna.pmv@gmail.com wrote:
hey, We are facing a problem with tiny_mc plugin where users seems to be inserting media/images by placing external urls which doesn't seem to respond for ever. As a result, all our httpd processes are waiting on those external network calls and affecting rest of the users. We have temporarily disabled tiny_mc and looking for ways to configure timeout either globally in roundcube or specifically for this plugin for ALL external http calls that roundcube makes.
Ok, it turns out to be a bug in roundcube here: https://svn.roundcube.net/trunk/roundcubemail/program/steps/utils/modcss.inc
Its neatly explained here: http://in2.php.net/manual/en/function.stream-set-timeout.php#71274
Thanks!
On 07/09/2012 07:17 AM, Krishna PMV wrote:
Ok, it turns out to be a bug in roundcube here: https://svn.roundcube.net/trunk/roundcubemail/program/steps/utils/modcss.inc
Its neatly explained here: http://in2.php.net/manual/en/function.stream-set-timeout.php#71274
I think there was a similiar issue in IMAP connections handling. Please, try with this patch.
--- program/steps/utils/modcss.inc +++ program/steps/utils/modcss.inc @@ -59,7 +59,7 @@ fwrite($fp, $out); // read response $header = true; $headers = array(); -while (!feof($fp)) { +while (!socket_eof($fp)) { $line = trim(fgets($fp, 4048));
if ($header) {
@@ -96,3 +96,19 @@ echo $error; exit;
+function socket_eof($fp) +{
return true;
return true;
+}
On 07/09/2012 10:03 AM, A.L.E.C wrote:
I think there was a similiar issue in IMAP connections handling. Please, try with this patch.
Please, also give a try to the attached patch. It simplifies the code significantly and moves timeout handling to the PHP internals.
hey Alec,
On Mon, Jul 9, 2012 at 1:33 PM, A.L.E.C alec@alec.pl wrote:
On 07/09/2012 07:17 AM, Krishna PMV wrote:
Ok, it turns out to be a bug in roundcube here:
https://svn.roundcube.net/trunk/roundcubemail/program/steps/utils/modcss.inc
Its neatly explained here: http://in2.php.net/manual/en/function.stream-set-timeout.php#71274
I think there was a similiar issue in IMAP connections handling.
I see in the version we are using ( 0.6-81336) , its handled well.
Please, try with this patch.
We've applied the following patch for this already. Hopefully it should work. Thanks a ton for your patch anyways.
--- modcss.inc. 2012-07-09 03:56:02.000000000 -0400 +++ modcss.inc 2012-07-09 04:00:05.000000000 -0400 @@ -49,6 +49,8 @@
// set timeout for socket stream_set_timeout($fp, 30); +stream_set_blocking($fp, TRUE); +$info = stream_get_meta_data($fp);
// send request $out = "GET $path HTTP/1.0\r\n"; @@ -59,7 +61,8 @@ // read response $header = true; $headers = array(); -while (!feof($fp)) { +while ((!feof($fp)) && (!$info['timed_out'])) { $line = trim(fgets($fp, 4048));
if ($header) {
@@ -78,6 +81,7 @@ else { $source .= "$line\n"; }
} fclose($fp);
-Krishna