Changeset 1062


Ignore:
Timestamp:
11/22/09 16:34:35 (2 years ago)
Author:
bogdan2412
Message:

Fix diff between revisions sometimes erroring

The problem was caused by fread not reading the full data from pipes. It apparently reads things in chunks as their are outputed to the pipe and since we close the pipe after a single read, iconv errors and says "broken pipe".
Replaced fread with stream_get_contents as is exemplified in the php manual and everything works ok.

Review URL: http://reviewboard.infoarena.ro/r/98/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/diff.php

    r1021 r1062  
    107107    fclose($lcs_in); 
    108108 
    109     $result = fread($lcs_out, 10000); 
     109    $result = stream_get_contents($lcs_out); 
    110110    fclose($lcs_out); 
    111111 
    112112    // check for errors 
    113     $errors = fread($lcs_err, 1000); 
     113    $errors = stream_get_contents($lcs_err); 
    114114    if ($errors) { 
    115115        log_error($errors); 
Note: See TracChangeset for help on using the changeset viewer.