I have been looking through the curl changes.  Nothing really jumps out
at me though.  Jani's curl handle change perhaps?  Doesn't seem like
that would cause this.

Anyway, here is a standalone little test case:

<?php
$url = 'http://slowgeek.com/test.xml';
$cfile = '/var/tmp/test_'.$prefix.md5($url).'.xml';
$ch = curl_init();
curl_setopt($ch, CURLOPT_FILE, $fp = fopen($cfile,'w'));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_URL, $url);
$status = curl_exec($ch);
if(!$status) echo curl_error($ch);
fclose($fp);  // No implicit flush here?
curl_close($ch);
$data = file_get_contents($cfile);
var_dump($data);  // 0 bytes here
fflush($fp);      // fflush after the fclose fixes it??
$data = file_get_contents($cfile);
var_dump($data);  // full contents here

In 5.2.9 this prints out the xml twice.  In 5.2.10 and our current 5.3
code, it prints out 0 bytes for the first var_dump.

This took down my Slowgeek site yesterday and was a bitch to debug and I
consider this a rather critical problem.

-Rasmus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to