ID: 25239 Updated by: [EMAIL PROTECTED] Reported By: mhumphrey at designvision dot com -Status: Verified +Status: Closed Bug Type: FTP related Operating System: Win32 PHP Version: 4.3.2 New Comment:
Seems I was right to blame PHP, but wrong in my initial diagnosis. PHP optimistically closes the control connection once the data connection is established. For most FTPds this works fine, however Serv-U obeys RFC959 section 2.3 which states: ----------------------------------------------- The protocol requires that the control connections be open while data transfer is in progress. It is the responsibility of the user to request the closing of the control connections when finished using the FTP service, while it is the server who takes the action. The server may abort data transfer if the control connections are closed without command. ----------------------------------------------- The fix will show up in the next snapshot and ver 4.3.4 or 5.0.0 (whichever comes first). Previous Comments: ------------------------------------------------------------------------ [2003-08-25 16:37:41] [EMAIL PROTECTED] I'm inclined to blame PHP for this. The root cause seems to be that the PHP streams layer is setting the EOF flag if there's no data ready and waiting on the socket. Meanwhile, Serv-U is waiting for clear output buffers to continue sending data. Serv-U's behavior isn't, strictly speaking, bad. PHP needs to learn how to handle this situation properly. I'll need to consult with the streams author to find a suitable fix. ------------------------------------------------------------------------ [2003-08-25 16:11:22] mhumphrey at designvision dot com Ah OK great. Yes, like i said it's only with Serv-U FTP, but that still doesn't tell us who's bug it is. Might want to mention it to them...it's a pretty popular product. Cheap license, effective, and easy to configure. I'll use the ftp_get() workaround for now. Thanks again! ------------------------------------------------------------------------ [2003-08-25 16:06:08] [EMAIL PROTECTED] @php.net mail isn't working right at the moment, but I've found an anonymous ftp server running Serv-U and verified it from linux, however it does indeed appear to be limited only to Serv-U servers (other daemons interact fine). ------------------------------------------------------------------------ [2003-08-25 15:55:08] mhumphrey at designvision dot com #1) ftp_connect(), ftp_login(), ftp_get() worked as expected...file was full 22 k. Seems to only be the functions that read into a string or the ob. So that's good to know for coding a workaround. #2) I'm the (35 year old) script kiddie who installed Serv-U on two seperate "unprotected" Win2k systems (well, i'm only a SK when i'm using PHP, the rest of the time i'm a C++adult ;) You can download a free 30 day trial of Serv-U at http://www.serv-u.com/customer/record.asp?prod=su I'll also give you an account on the Serv-U at our office that you may test with, i'll send that login info by email. Thanks for the quick reply! ------------------------------------------------------------------------ [2003-08-25 15:37:27] [EMAIL PROTECTED] #1) Could you try the same transfer using the ftp extension? (i.e.: ftp_connect(), ftp_login(), etc...) #2) Is there a public Serv-U FTP server available to test against which you can point me towards? (The only ones I've ever come across were installed by script kiddies on unprotected windows boxes -- Not that I'm blaming the software mind you) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/25239 -- Edit this bug report at http://bugs.php.net/?id=25239&edit=1
