| Dart Home | PowerTCP FTP for ActiveX | Custom Development | Reply | PowerTCP FTP for ActiveX Topics | Forums |
| Author | Forum: PowerTCP FTP for ActiveX Topic: FTP Store (PASV) Timeout = 0 |
| PeteY From: London, United Kingdom Posts: 34 Member Since: 01/13/03 |
posted March 31, 2004 10:03 AM I am having a problem using Store when timeout is 0 and working in PASV mode. The code in my client invokes the Store method and from a line trace this generates the following exchange:- Client Server Port PASV ----> 21 <---- 227 Entering Passive... 21 STOR <file> -----> 21 Three way handshke (SYN SYN/ACK etc) Data <file data> -----> Data FIN and FIN/ACK Data <---- 150 Opening Binary .... 21 SYN ----> Data+1 <---- RST Data+1 <---- FIN Data+1 etc. The problem appears to be that the file is sent PRIOR to receving the '150 Opening Binary...' message and the server is not accepting the file data (it shows as containing 0 bytes). If Timeout > 0 (as in the sample application from Dart) then the control waits for the '150' message before sending the file data and everything is OK. Both client and server are using Dart controls. There doesn't appear to be a way of sending the PASV message in isolation (from Store) so don't appear to have any control on when the file data is actually tranmsitted. In the circumstances described it appears to be sent too soon (prior to 150 response from server). Am I doing something wrong or do I have to use a timeout value > 0 if using PASV mode? Thanks Pete Young. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted March 31, 2004 10:09 AM Does it happen every time? In order for me to report this as a bug, I have to be able to duplicate it in a test program. Is there anything special I need to do? |
| PeteY From: London, United Kingdom Posts: 34 Member Since: 01/13/03 |
posted March 31, 2004 10:51 AM Yes, it appears to be consistent with PASV set and timeout = 0. The only thing I would say is that I am using the SecureFtp control with no-authentication, SSL Type = None and Port 21 for FTP command. Sorry if I've misfiled this report (I always think I'm using 'normal' FTP as I don't use any of the secure options for the control). |
| PeteY From: London, United Kingdom Posts: 34 Member Since: 01/13/03 |
posted March 31, 2004 11:05 AM Just to add the problem can be replicated by using the Dart SecureFtp Client code and inserting the statement:- pSecureFtp->TimeOut = 0; just prior to it invoking Store. Thanks. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted March 31, 2004 11:22 AM If I were to do what you say in the sample, many problems would occur because immediately after the Store we call List (in the DoRefesh function) When timeout = 0 the method immediately returns (asynchronous mode) and if the Store does not complete fast enough, the list will be done before the store finishes. Is that maybe what's happening to you? |
| PeteY From: London, United Kingdom Posts: 34 Member Since: 01/13/03 |
posted March 31, 2004 11:30 AM In my original code |
| PeteY From: London, United Kingdom Posts: 34 Member Since: 01/13/03 |
posted March 31, 2004 11:32 AM Tony, thanks for the quick replies. I'll have to get back to you on Monday. I'm afraid it's 'going home time' in the UK and I'm not back at work until next week. That'll give me time to consider what you've written. Regards |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted March 31, 2004 11:34 AM Ok then. Cheers! |
| PeteY From: London, United Kingdom Posts: 34 Member Since: 01/13/03 |
posted April 5, 2004 6:48 AM Tony, Thanks for your advice. After reading what you said and stepping back to look at the problem afresh I'm now eating loads of humble pie. I'm 99% certain the problem is in my server (code) and not in the client. I confirmed this by using the FTP client sample code, setting Timeout =0 AND commenting out the subsequent DoRefresh function (though I realise this is a bit rough and ready) and running it against the ACTUAL sample FTP server code - all OK. Anyway, once again thanks for your wisdom and I'll try not to jump to conclusions in future! Pete Young. |
| PeteY From: London, United Kingdom Posts: 34 Member Since: 01/13/03 |
posted July 6, 2004 9:20 AM GOING OVER OLD GROUND. |
| PeteY From: London, United Kingdom Posts: 34 Member Since: 01/13/03 |
posted July 6, 2004 9:27 AM Sorry, previous message sent by mistake. HOWEVER I think I can understand this problem a bit more now and I'm wondering if there is a slight bug in the Store command code. Recap: PASV mode store - Timeout = 0. I think there is a potential (timing) problem with small files OR if the server is slightly slow in sending the "150" message to the client. In these circumstances it is possible for the client to have opened the Data connection and sent the file before it has received the "150" message from the server. Once it receives the "150" message it seems to want to open another TCP data connection but isn't allowed to by the server. Does this sound feasible and if so should the client wait for the "150" message before establishing the data connection? |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted July 6, 2004 9:48 AM This problem is going to be a little hard to troubleshoot over the forum. 99% of the time someone reports a bug with asynchronous code it turns out to be something they are doing that is causing a timing problem. If you need for us to look into this, please contact David Harry (sales@dart.com) to discuss what other support options are available. Eventually we will need a way to reproduce this on a server that is available to both of us. |
| Reply | PowerTCP FTP for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|