php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37689 Read buffer out of sync with issued commands
Submitted: 2006-06-03 22:45 UTC Modified: 2006-06-13 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jasper dot e at gmail dot com Assigned:
Status: No Feedback Package: FTP related
PHP Version: 5.1.4 OS: Fedora Core 2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
50 - 2 = ?
Subscribe to this entry?

 
 [2006-06-03 22:45 UTC] jasper dot e at gmail dot com
Description:
------------
I have a piece of code crawling an ftp site, ftp_chdir()'ing and ftp_get()'ing a lot of files troughout the ftp dirtree.

I have noticed, that after a failed ftp_get() the read buffer often goes out of sync with the issued commands.
In other words; an ftp_chdir() command shows a warning with the result message from a previous command.

Here's an example PHP warning:
<b>Warning</b>: ftp_chdir() [<a href='function.ftp-chdir'>function.ftp-chdir</a>]: ABOR command successful. in <b>/home/frozen/frozftp.class.php</b> on line <b>93</b><br />



Reproduce code:
---------------
The code this error originates from has the following snippet in it, which is called for each dir it's supposed to crawl:
if ($SFTP->cwd($dirname) === false) { $SFTP->abor(); return false; }

The cwd and abor functions from the SFTP class:
        function cwd($path)
        {
                return (ftp_chdir($this->fd,$path)) ? true : false;
        }
        function abor()
        {
                ftp_raw($this->fd,"ABOR");
        }

Expected result:
----------------
I would expect the ftp_chdir() function to return a true value

Actual result:
--------------
A warning message from the ftp_chdir() with the result from a previous command in it.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-05 07:46 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2006-06-13 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC