QFTP doesn't work on some machines

QFTP doesn't work on some machines

Postby codemaker » Tue Jan 25, 2011 1:33 am

We have a software which allow our clients to upload some files for technical support.
The program is written in xHarbour/Fivewin both from the year 2009

Almost 99% of our clients can send the files to our server and 1% of them cannot.

The clients that cannot send the files, encounter the frozen program after selecting the files to send. Nothing happens, not even some error message. They have to kill the program from Task manager.

These clients are able to connect to internet normaly, download files from browsers, actualy they can use internet without any problem.
When they want to send the files on our server (as other 99% clients do), using our program, the program freezes.

I have no idea what might be the problem and what to check on client side.
I red something on Internet that if the connection to internet is through proxy, the ftp programs might have problems. But, I have no idea how to check and evaluate eventualy proxy settings. If this is the problem at all.

I would apreciate any suggestion or idea or help
Boris

The code looks generaly (just a sample and is really elemantary) something like this:
I tracked down the moment of freezing, it is when the FOR/NEXT loop starts in function sendfiles()
Code: Select all  Expand view

.....
.....
cFTPSite := "xx.xx.xx.xx"    

IF lHaveZips
   * Send both (ZIP and INI)
   aTarget := { cFTPfile, cFTPmemoFile }        // on FTP
   aSource := { cFileZIP, cMemoFile }                  // on LOCAL machine
ELSE
   * Send only INI file
   aTarget := { cFTPmemoFile }      // on FTP
   aSource := { cMemoFile }                // on LOCAL machinje
ENDIF

cUname := "abcdefgh"  
cUpass := "123456"  

oInternet := TInternet():New()
oFTP := TFTP():New( cFTPSite, oInternet,cUname,cUpass )
IF EMPTY( oFTP:hFTP )
     MsgStop( "Error" )
     RETURN(.F.)
ENDIF

cMsg := "Please wait, sending... [ 0KB of 0KB sent ]"   ;   cMsg1 := cMsg
cTitle := "PLEASE WAIT"
MsgMeter( { |oMeter, oText, oDlg, lEnd| ;
        SendFiles(aSource, aTarget, nBufSize, oFTP, nSize, oMeter, oText, oDlg, @lEnd ) }, cMsg, cTitle )
oInternet:End()
...
...

static Function SendFiles( aSource, aTarget, nBufSize, oFTP, nTotalSize, oMeter, oText, oDlg, lEnd )
*-------------------------
oMeter:nTotal = nTotalSize
nCount := 1
cSent := ALLTRIM(STR(INT(nTotalSize/1000)),18,0)

// -------- Here it enters the FOR/NEXT and stays there forewer... on 1% of clients machines ------- //  
for n = 1 to Len( aSource )
         hSource = FOpen( aSource[ n ] )
       
        IF hSource > 1  
         oFile = TFtpFile():New( aTarget[ n ], oFTP )
             oFile:OpenWrite()
             FSeek( hSource, 0, 0 )
             
             nFile := 0
             while ( nBytes := FRead( hSource, @cBuffer, nBufSize ) ) > 0 .and. ! lEnd
                  oMeter:Set( nRaiseBytes )
              oText:SetText(cc) 
              SysRefresh()
       
              oFile:Write( SubStr( cBuffer, 1, nBytes ) )  
          nRaiseBytes+= nBytes
                  cc := "Please wait, sending... [ " + ALLTRIM(STR(INT(nRaiseBytes/1000)),18,0) + "KB of " + cSent + "KB sent ]"
              end

          FClose( hSource )
             oFile:End()
        ELSE  // cannot open the file
            MSGSTOP("Error 2928 - restricted from opening the file "+ aSource[ n ] + CRLF+ ;
                           " Cannot Continue. Check with your IT Person " + CRLF+ ;
                               " Program will Shut Down ")
            close databases
            RESALLFREE()
               QUIT
        ENDIF    //hSource > 1
next n

lEnd := .T.
return(.T.)

 
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: QFTP doesn't work on some machines

Postby Bayron » Tue Jan 25, 2011 1:44 am

CodeMaker,

Does the Zip files contain .EXE files?

Maybe even the Zip files may be stoped by the firewall...

Have you tried to send other kind of files?
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: QFTP doesn't work on some machines

Postby codemaker » Wed Jan 26, 2011 2:15 am

No, I am not sending any EXE files. Only the pure text INI file....

Today I tracked down on one machine wich has problem with this and I found that the problem is:

Code: Select all  Expand view

    oFile = TFtpFile():New( aTarget[ n ], oFTP )
    oFile:OpenWrite()      // <= this is the poit where the process hangs....
 


Where is this OpenWrite() function?
I need to check what this function does and in which conditions it hangs up.....

Boris
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: QFTP doesn't work on some machines

Postby Bayron » Wed Jan 26, 2011 3:36 am

CodeMaker,

\source\classes\tftpfile.prg
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: QFTP doesn't work on some machines

Postby codemaker » Wed Jan 26, 2011 3:28 pm

Thank you, will review this.
I still think that the problem is somehow related with client system settings.
However, have no idea where to look and what to check on clients side.

Maybe after I take a look into this PRG I might get better idea...
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: QFTP doesn't work on some machines

Postby codemaker » Wed Jan 26, 2011 3:54 pm

Unfortunatelly, this function doesn't put any light on my problem.
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: QFTP doesn't work on some machines

Postby Bayron » Wed Jan 26, 2011 4:19 pm

Maybe you should start with windows firewall either tell the user to disable it temporally

or

Control Panel, Windows Firewall, Advanced Configurations and see if the App has rights to send information blocked....


I would try the first option first, and also disable antivirus... (temporally) just to test
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: QFTP doesn't work on some machines

Postby codemaker » Wed Jan 26, 2011 6:39 pm

Believe me, I did all this several times, including closing all Antivirus/Spayware programs.
Firewall is completely off, including the part which overrides the stop.
Checked all Security issues in "Internet settings"....

Tried a lot and the same code simply doesn't work on a few clients machine.
It has to do something with system settings or memory...
Looks like the clients machine, closes the connection imediatelly after oFile:Write() starts, without transfering anything...

It is very frustrating when 95% works and 5% doesn't and I cannot do anything.

Anyway, thanks for your attention

Boris
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: QFTP doesn't work on some machines

Postby Bayron » Wed Jan 26, 2011 8:35 pm

Since you don't know how to set proxy settings, you probably don't have a proxy server...

It may be that the explorer works because is using Pasive connections (www)

And your router is blocking FTP connections????

I don't know much about this issue, I am just talking out loud....
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: QFTP doesn't work on some machines

Postby Bayron » Wed Jan 26, 2011 8:44 pm

Try to connect using a FTP Client???

Maybe from command line:

FTP ftp.website.com


will prompt for user name and password
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: QFTP doesn't work on some machines

Postby codemaker » Thu Jan 27, 2011 1:32 am

On one machine I am using Total Commander and its FTP feature. Working Upload/Download without problem.
Also I can use browser to download from FTP site.

I also rewrote the functions which uploads the file, complete diferent logic... Works on many machines but for the client it din't work before, still doesn't work ...
This is why I am sure something is blocked on their computers.
Trying to figure out what.

Thanks for your attention

Boris
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 57 guests