Investigated tidy deadlock allegations, couldn't reproduce.
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 7 Feb 2006 11:05:00 +0000 (11:05 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 7 Feb 2006 11:05:00 +0000 (11:05 +0000)
includes/Parser.php

index bbe08ae..0d73a4a 100644 (file)
@@ -623,6 +623,11 @@ class Parser
                $pipes = array();
                $process = proc_open("$wgTidyBin -config $wgTidyConf $wgTidyOpts$opts", $descriptorspec, $pipes);
                if (is_resource($process)) {
+                       // Theoretically, this style of communication could cause a deadlock
+                       // here. If the stdout buffer fills up, then writes to stdin could 
+                       // block. This doesn't appear to happen with tidy, because tidy only
+                       // writes to stdout after it's finished reading from stdin. Search 
+                       // for tidyParseStdin and tidySaveStdout in console/tidy.c
                        fwrite($pipes[0], $text);
                        fclose($pipes[0]);
                        while (!feof($pipes[1])) {