Go Back   FlashFXP Forums > > > >

Bug Reports Report bugs here. (non-beta releases only)

 
 
Thread Tools Display Modes
Old 05-10-2002, 04:04 AM   #1
superbonbon
Junior Member
 
Join Date: May 2002
Posts: 5
Default socket implementation problem ?

I have created a java ftp server and there's a problem when it comes to upload files on my server ( download works fine.. )

Clients using flashfxp can upload only a few bytes ( usually 14kb ) of a file on the server, while other ftp clients ( cute ftp, ws_ftp ) are working fine and upload the file completly.

The loop that reads data from the flashfxp DTP socket stream, return EOF after a few byte have been uplaoded, there's no stream or socket close.

Any idea where that problem could come from ? ( could be you or java.. i have checked java and found nothing about such issue.. )
superbonbon is offline  
Old 05-27-2002, 09:52 AM   #2
bigstar
FlashFXP Developer
FlashFXP Administrator
ioFTPD Beta Tester
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

I have no clue what would cause this. Let me know if you figure anything out.
bigstar is offline  
Old 05-28-2002, 05:59 AM   #3
superbonbon
Junior Member
 
Join Date: May 2002
Posts: 5
Default

I have finally found the problem, I was calling a inputstream.shutdown() method when I was sending a file or outputstream.shutdown() method when I was receiving a file,
I was doing this for some security and optimization reasons ( make sure that only required streams are open during transactions ), it looks like that on certain socket implementation, the shutdown() method call will cause that behaviour.

I do not use this shutdown method anymore, I prefer to have something that works with your client but a little bit less secure.
superbonbon is offline  
Old 05-28-2002, 06:29 AM   #4
bigstar
FlashFXP Developer
FlashFXP Administrator
ioFTPD Beta Tester
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

FlashFXP uses shutdown() when closing a connection.
Are you setting so_linger before calling shutdown()?
bigstar is offline  
Old 05-28-2002, 05:57 PM   #5
superbonbon
Junior Member
 
Join Date: May 2002
Posts: 5
Default

yeah i tried the so linger setting but it did not help

the only way for me to make that stuff work it to make sure that the socket inputstream or outputstream objects are not shutdowned during the DTP socket initialization.
superbonbon is offline  
Old 06-02-2002, 08:11 AM   #6
bigstar
FlashFXP Developer
FlashFXP Administrator
ioFTPD Beta Tester
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

I recently discovered a problem in FlashFXP that might explain the compatiblity issue with your FTP server.

Why don't you go ahead and add shutdown() back to your ftp server and give the latest beta a try build 855
bigstar is offline  
Old 06-03-2002, 01:16 PM   #7
superbonbon
Junior Member
 
Join Date: May 2002
Posts: 5
Default socket problem

Thanks Bigstar

Unfortunatly your latest build still does not solve my problem.
the socket.shutdownoutput() methods are still not working.. when i try to upload a file, the EOF is sent at the first byte..
sessionSocketDTP.shutdownOutput() causes the problem with your client, the same code works perfectly fine with other FTP clients.

Well thanks for trying to fix something, but looks like the gremlin is the winner this time )

If you wanna give it a last try, Here is the method I call to initialize the DTP socket with a comment where the method call causes problems, i hope it will help you a little bit ( even if i doubt about it ) :

public void initializeDTPSocket( boolean openInputStream, boolean openOutputStream, boolean useCharSet ) throws IOException {

if ( openInputStream && openOutputStream ) {
throw new IOException( "Opening DTP output and input at the same time is not allowed" );
}

if ( !isPASVMode ) {
sessionSocketDTP = getNewDTPSocket( getSessionDetails().getHostAddress(), getSessionDetails().getDTPPort() );
initializeSocket();
}

if ( sessionSocketDTP == null ) {
throw new IOException( "DTP Socket has not been initialized use PORT or PASV command first" );
}

if ( openInputStream ) {
if ( useCharSet ) {
inputReader = new InputStreamReader( sessionSocketDTP.getInputStream(), getPIrw().getCurrentCharSet() );
} else {
input = new BufferedInputStream( sessionSocketDTP.getInputStream(), inputDTPBuffSize );
}
// that method call causes the problem when uploading a file
sessionSocketDTP.shutdownOutput();
// result : EOF reached after first byte read with method input.read().
}
if ( openOutputStream ) {
if ( useCharSet ) {
outputWriter = new OutputStreamWriter( sessionSocketDTP.getOutputStream(), getPIrw().getCurrentCharSet() );
} else {
output = new BufferedOutputStream( sessionSocketDTP.getOutputStream(), outputDTPBuffSize );
}
// that call doesn t seems to bring troubles when a file is sent
sessionSocketDTP.shutdownInput();
}
}
sorry for the code indentation
superbonbon is offline  
 

Tags
ftp, java, server, socket, upload

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CHMOD bug iXi Bug Reports 2 12-23-2002 07:53 AM


All times are GMT -5. The time now is 01:06 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)