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 RUN
.....
.....
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.)