From:             mhumphrey at designvision dot com
Operating system: Win32
PHP version:      4.3.2
PHP Bug Type:     FTP related
Bug description:  FTP functions won't retrieve more than ~8k from Serv-U FTP server

Description:
------------
FTP functions won't retrieve more than ~8k from Serv-U FTP server ver 4.1
( www.rhinosoft.com ). Anything over that gets truncated and a QUIT
appears in the server log in mid-transfer.

I'm using PHP 4.3.2 on Win32 with Apache 2.0.46

I don't know if this is PHP or Serv-U that's off spec here...all i know is
they don't seem to like each other.


Reproduce code:
---------------
Just use any FTP function and try to pull a >8k text file down from a
Serv-U server.  Seems to effect every FTP capable function i've tried:
fread(), readfile(), file_get_contents(), etc...

Expected result:
----------------
A string of the same size as the file on the FTP server.

Actual result:
--------------
Your returned data will be truncated at around the 8k point.

Here's what Serv-U's log has to say, notice the QUIT that seems to come up
in mid-transfer, possibly a clue?:

[2] Mon 25Aug03 13:31:01 - (000012) RETR /entertainment.xml
[3] Mon 25Aug03 13:31:01 - (000012) Sending file
c:\apache2\htdocs\momo\entertainment.xml
[7] Mon 25Aug03 13:31:01 - Sock ID=32 accept(504,0x010F9F74,0x010F9F9C)
--> 464 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32 ioctlsocket(464,FIONBIO,0x010F9F88)
--> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32
WSAAsyncSelect(464,65580,1024,FD_READ FD_WRITE FD_CLOSE) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=31 WSAAsyncSelect(504,65580,0,<<NONE>>)
--> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=31
setsockopt(504,SOL_SOCKET,SO_LINGER,0x010F9F30,4) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=31 shutdown(504,0) --> -1
(WSAENOTCONN)
[7] Mon 25Aug03 13:31:01 - Sock ID=31 shutdown(504,1) --> -1
(WSAENOTCONN)
[7] Mon 25Aug03 13:31:01 - Sock ID=31 closesocket(504) --> 0 (OK)
[6] Mon 25Aug03 13:31:01 - (000012) 150 Opening BINARY mode data
connection for entertainment.xml (21289 bytes).
[7] Mon 25Aug03 13:31:01 - Sock ID=32
setsockopt(464,SOL_SOCKET,SO_OOBINLINE,0x010FA860,4) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32
setsockopt(464,SOL_SOCKET,SO_KEEPALIVE,0x010FA850,4) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32
setsockopt(464,IPPROTO_TCP,TCP_NODELAY,0x010FA840,4) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32
setsockopt(464,SOL_SOCKET,SO_SNDBUF,0x010FA834,4) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32
setsockopt(464,SOL_SOCKET,SO_RCVBUF,0x010FA824,4) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=30 RB_READ Stat=OK
[7] Mon 25Aug03 13:31:01 - Sock ID=30 recv(440,0x016CDC78,2048,0) --> -1
(WSAEWOULDBLOCK)
[7] Mon 25Aug03 13:31:01 - Sock ID=30 WSAGetLastError() -->
WSAEWOULDBLOCK
[7] Mon 25Aug03 13:31:01 - Sock ID=32 FD_WRITE Stat=OK
[7] Mon 25Aug03 13:31:01 - Sock ID=32 send(464,0x016A0209,4096,0) --> 4096
(OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32 send(464,0x016A1209,4096,0) --> 4096
(OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32 send(464,0x016A2209,4096,0) --> -1
(WSAEWOULDBLOCK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32 WSAGetLastError() -->
WSAEWOULDBLOCK
[7] Mon 25Aug03 13:31:01 - Sock ID=30 RB_WRITE Stat=OK
[7] Mon 25Aug03 13:31:01 - Sock ID=30 send(440,0x016C93C4,78,0) --> 78
(OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32 RB_WRITE Stat=OK
[7] Mon 25Aug03 13:31:01 - Sock ID=32 send(464,0x016A2209,4096,0) --> -1
(WSAEWOULDBLOCK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32 WSAGetLastError() -->
WSAEWOULDBLOCK
[7] Mon 25Aug03 13:31:01 - Sock ID=30 FD_READ Stat=OK
[7] Mon 25Aug03 13:31:01 - Sock ID=30 recv(440,0x016CDC78,2048,0) --> 6
(OK)
[2] Mon 25Aug03 13:31:01 - (000012) QUIT
[6] Mon 25Aug03 13:31:01 - (000012) 221 Goodbye!
[7] Mon 25Aug03 13:31:01 - Sock ID=32 WSAAsyncSelect(464,65580,0,<<NONE>>)
--> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32
setsockopt(464,SOL_SOCKET,SO_LINGER,0x010FB378,4) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32 shutdown(464,0) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32 shutdown(464,1) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=32 closesocket(464) --> 0 (OK)
[3] Mon 25Aug03 13:31:01 - (000012) Error sending file
c:\apache2\htdocs\momo\entertainment.xml, aborting (107 Kb/sec - 8192
bytes, reason unknown)
[6] Mon 25Aug03 13:31:01 - (000012) 426 Data connection closed, file
transfer entertainment.xml aborted.
[7] Mon 25Aug03 13:31:01 - Sock ID=30 RB_READ Stat=OK
[7] Mon 25Aug03 13:31:01 - Sock ID=30 recv(440,0x016CDC78,2048,0) --> 0
(OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=30 RB_WRITE Stat=OK
[5] Mon 25Aug03 13:31:01 - (000012) Closing connection for user MOMO
(00:00:02 connected)
[7] Mon 25Aug03 13:31:01 - Sock ID=30 WSAAsyncSelect(440,65580,0,<<NONE>>)
--> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=30
setsockopt(440,SOL_SOCKET,SO_LINGER,0x010FEA1C,4) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=30 shutdown(440,0) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=30 shutdown(440,1) --> 0 (OK)
[7] Mon 25Aug03 13:31:01 - Sock ID=30 closesocket(440) --> 0 (OK)


-- 
Edit bug report at http://bugs.php.net/?id=25239&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25239&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25239&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25239&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25239&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25239&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25239&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25239&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25239&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25239&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25239&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25239&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25239&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25239&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25239&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25239&r=gnused

Reply via email to