Re: Bug #1053: Bizarre corruption problem with files gotten by readfile/fpassthru/etc.
| From: | Rasmus Lerdorf | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: Bug #1053: Bizarre corruption problem with files gotten by readfile/fpassthru/etc. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-3481@lists.php.net to get a copy of this message | ||
> Now, here is where it gets odd. Again, some files work (other WinZip generated files worked)
> but not others. I just realized I did not try a larger file than this to see if maybe the problem
> is related to the file size. Smaller files did work. It didn't occur to me that it could be
> size related until now.
Is this problem browser dependant at all or are you seeing the same thing
with both IE and Netscape? How about lynx and wget from a Unix box?
Looking at the code for ReadFile() I really don't see where this sort of
corruption could be taking place. The main loop of the function looks
like this:
if (php3_header()) { /* force header if not already sent */
while(issock?(b=SOCK_FGETS(buf,sizeof(buf),socketd)):(b = fread(buf, 1, sizeof(buf), fp))
> 0) {
PHPWRITE(buf,b);
size += b ;
}
}
The buf size is 8192 which simply means it reads the file in 8192 chunks
one after the other until there is no more data using fread().
Could you perhaps also provide URL's to this file you are seeing the
corruption with along with the test file directly without any PHP wrapper
so I can try various ways of fetching it and comparing the results. I am
very skeptical about this being a PHP bug.
-Rasmus
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net