Bug Fix: Delphi 7 indy 9.0 IndyFTP ReadTimeout is not work (idFTP.pas)

delphi

    Sponsored Links

    Next

  • 1. newbie : Best way to send Email?
    Hello, i am using D6 and Indy9 to write an email application that sends a 65kb PDF document to about 500 email addresses. i am adding all 500 email addresses in a loop with the following: BccList.Add.Text := "PersonsName"<EmailAddress> i am able to send the email, but it took about an hour to send and only about 190 emails made it to their destination. Is there a limit on the number of addresses in a BCCList? Why did it take an hour to send? What did i do wrong? How do i speed this up and improve the results? Any help is appreciated, Robby
  • 2. Need help reporting progress on tidftp
    hello I'm using indy 9 on delphi 7 win XP and I am building an ftp client. theproblemis that I am using a listview component to show the files on the ftp server. When the user clicks on an item a tfilestream objects is created and I use the idftp.get method to download the file. The problem is that execution doesn't move to the next line of code until the file has completely downloaded thus the progress bar and the size label I am trying to fill remain empty until the end of the download. Any answers would be appreciated 10x Mewt
  • 3. Progress problem on file sending
    Hi, I created a class for to send files with TidTCPClient. Here is my class : TTcpThread = class(TThread) private FSocket: TIdTCPClient; FData: TStream; FProgress: TProgressBar; .. protected .. procedure Execute; override; procedure UpdateProgress; .. public .. .. property Data: TStream read FData write FData; property Progress: TProgressBar read FProgress write FProgress; end; The thing i want to know is what is the best way to show the progress of file sending with this logic ? procedure TTcpThread.Execute; begin inherited; try with FSocket do begin Connect; WriteStream(FData); // UpdateProgress; if i'll put this code here, it shows after the job finished.. (normally :)) Disconnect; end; finally FSocket.Free; end; Terminate; end; Should i assign like this FSocket.OnWork := DoOnWork and then refresh the progress in DoOnWork ? Is this a good way ? I tried it works but when i move the form progress is not continue to refresh. Any other way ? Cheers, Tomas
  • 4. Need several fresh ideas
    Hello I need several ideas about the following: I have to make an application very similar to Yahoo Messanger - i.e. it has to provide users with the ability to chat in a public room and also to be able to speak to each other and view each other - i.e. This application is supposed to make audio and video transmission. Now according to the text chatting I have no problems. I am using Indy and I have organized a server application that is listening on a port and accepts users messages and broadcast them to the other users. This is OK. Here are my dificulties: I am not quite sure how I have to organize the audio and video transmission. If I follow the Yahoo Messanger ideas I am supposed to make point to point A/V streaming - i.e. when User1 requests to view User2's web cam User2 must open a port and to start broadcast his video on this port i.e. User2 two becomes a server and User1 connects directly to it. Is it a good idea to use this approach or you have some other better ideas? Also - what will happen if User2 is behind a proxy and his real IP address is masked? I would appreciate all your experience and you ideas about this and also about the way how to design such an application. Please note here that my questions are not concerning the actual A/V streaming techniques (I am using DSPack for this) but they are more design-oriented. Thanks
  • 5. Socket error 10061
    I am using Delphi 7 and I have purchased the latest Indy components version 9. Using the DempFTP program I try and access an FTP site. I seem to connect to the site successfully but then I get a "socket error 10061" and I get disconnected. This was originally working but the server site has gone through some major security enhancements. To meet the new security requirements I am using a product called SafeTP. Any ideas why i am getting this error? Also sometimes I get a message back from the server : "533 Must send Auth first RFC 959 compatability is off" Any thought on why I am getting this? Any help would be GREATLY appreciated! Thanks, Joe

Bug Fix: Delphi 7 indy 9.0 IndyFTP ReadTimeout is not work (idFTP.pas)

Postby fluber » Mon, 12 Nov 2007 17:28:51 GMT

Dear All:

   When use idftp to get a file from ftp server and the wireless ap is
shutdown,  the idftp seems to in the endless loop.
and do detect this case, not raise a timeout exception.
   I already set the ReadTimeout property of IdFTP Component, but
seems not work. I decide to trace the source code
and I found the procedure TIdFTP.InternalGet has a bug in the
following code section.

        with TIdSimpleServer(FDataChannel) do begin
          TIdSimpleServer(FDataChannel).ReadTimeout :=
self.ReadTimeout;   / / I add this line
          InitDataChannel;
          BoundIP := (Self.IOHandler as
TIdIOHandlerSocket).Binding.IP;
          BeginListen;
          SendPort(Binding);
          if AResume then begin
            Self.SendCmd('REST ' + IntToStr(ADest.Position), [350]);
{Do not translate}
          end;
          Self.SendCmd(ACommand, [125, 150, 154]); //APR: Ericsson
Switch FTP
          Listen;
          ReadStream(ADest, -1, True); // make this proceduer logic
error
        end;

In this secion create a TIdSimpleServer object but not initialize the
ReadTimeout property, so that make ReadStream logic error.
ReadStream will call ReadBuffer and will call ReadFromStack.



function TIdTCPConnection.ReadFromStack(const
ARaiseExceptionIfDisconnected: Boolean = True;
 ATimeout: Integer = IdTimeoutDefault; const ARaiseExceptionOnTimeout:
Boolean = True): Integer;
// Reads any data in tcp/ip buffer and puts it into Indy buffer
// This must be the ONLY raw read from Winsock routine
// This must be the ONLY call to RECV - all data goes thru this method
var
  i: Integer;
  LByteCount: Integer;
begin
  if ATimeout = IdTimeoutDefault then begin
    if ReadTimeOut = 0 then begin
      ATimeout := IdTimeoutInfinite;
    end else begin
      ATimeout := FReadTimeout;  // if donot add the
"TIdSimpleServer(FDataChannel).ReadTimeout := self.ReadTimeout;  "
this value will be zero
    end;
  end;


B.R.

Fluber Wang


Bug Fix: Delphi 7 indy 9.0 IndyFTP ReadTimeout is not work (idFTP.pas)

Postby fluber » Mon, 12 Nov 2007 17:30:28 GMT

Dear All:

   When use idftp to get a file from ftp server and the wireless ap is
shutdown,  the idftp seems to in the endless loop.
and do detect this case, not raise a timeout exception.
   I already set the ReadTimeout property of IdFTP Component, but
seems not work. I decide to trace the source code
and I found the procedure TIdFTP.InternalGet has a bug in the
following code section.

        with TIdSimpleServer(FDataChannel) do begin
          TIdSimpleServer(FDataChannel).ReadTimeout :=
self.ReadTimeout;   / / I add this line
          InitDataChannel;
          BoundIP := (Self.IOHandler as
TIdIOHandlerSocket).Binding.IP;
          BeginListen;
          SendPort(Binding);
          if AResume then begin
            Self.SendCmd('REST ' + IntToStr(ADest.Position), [350]);
{Do not translate}
          end;
          Self.SendCmd(ACommand, [125, 150, 154]); //APR: Ericsson
Switch FTP
          Listen;
          ReadStream(ADest, -1, True); // make this proceduer logic
error
        end;

In this secion create a TIdSimpleServer object but not initialize the
ReadTimeout property, so that make ReadStream logic error.
ReadStream will call ReadBuffer and will call ReadFromStack.



function TIdTCPConnection.ReadFromStack(const
ARaiseExceptionIfDisconnected: Boolean = True;
 ATimeout: Integer = IdTimeoutDefault; const ARaiseExceptionOnTimeout:
Boolean = True): Integer;
// Reads any data in tcp/ip buffer and puts it into Indy buffer
// This must be the ONLY raw read from Winsock routine
// This must be the ONLY call to RECV - all data goes thru this method
var
  i: Integer;
  LByteCount: Integer;
begin
  if ATimeout = IdTimeoutDefault then begin
    if ReadTimeOut = 0 then begin
      ATimeout := IdTimeoutInfinite;
    end else begin
      ATimeout := FReadTimeout;  // if donot add the
"TIdSimpleServer(FDataChannel).ReadTimeout := self.ReadTimeout;  "
this value will be zero
    end;
  end;


B.R.

Fluber Wang


Similar Threads:

1.Fixed bugs IdCookies.pas, IdCookieManager.pas

Hello Indy users and Indy experts.

I use Indy 9.0.14 (D5)
After torture tests, i've noticed some bugs for cookies management :
- subdomains are not supported :a cookie available for mydomain is
considered as not valid (isvalidcookie) for subdomain.mydomain
- domains and paths not correctly managed by TidCookieManager : when a
cookie is added to the cookies collection, it's added to a cookiesbyDomain
section which is a TStringList for a particular domain. Inside this section,
only the name is considered and not the path.
- The generateCookie list method doesn't support cookies for same domain but
different paths (like prior bug)
- The Cookie collection is not or can't be correctly freed : The
cleanUpCookieList method only drops expired cookies on the fly and when the
component is destroyed. Even in this case, only cookies objects are freed
but not Tstring items

All have been reported in bbg section for indy team, and this news group,
but because Indy team was to busy, i had to fix theses bugs by myself...
As chad suggested, i post this message :
1/ for indy experts to check this with me and eventually integrate the fixed
units
2/ for other users that have theses problems too and want a quick solution.



FLX.


2.[Q] Converting Delphi 6 Indy 8.xx to Delphi 2006 Indy 10.xx

G'Day,

I have a whole heap of old Delphi 6 code that is based on Indy 8.xx
that I need to convert to Delphi 2006 Indy 10.xx. Naturally the
architecture has changed between 8.xx and 10.xx. Is there a conversion
guide or anything similair that I can look at? I have looked on the
doco site but there does not seem to be anything. Is there also some
documentation on how the architecture has changed between 8.xx and
10.xx I could have a read of?

Failing all of the above has anyone got any suggestions on how to do
the Indy 8.xx to 10.xx conversion with the least amount of pain? ;-)

TIA

-- 
--Donovan

3.TIdContext.Connection.ReadTimeout not work

AContext.Connection.IOHandler.ReadInteger not return after 25 ms.

********************************************************

function TIdTCPServer.DoExecute(AContext: TIdContext): Boolean;
begin
  AContext.Connection.IOHandler.ReadTimeout := 25;
  AContext.Connection.IOHandler.ReadInteger;
end;

********************************************************
I must use

        TIdIOHandlerStack(AContext.Connection.IOHandler).ReadTimeout := 25;

the readtimeout will work.


Must I use         TIdIOHandlerStack  to force ReadTimeout ??


4.ReadTimeout not working intermittently with TIdHTTPClient.Post

We've experienced some weird behavior on one of our systems that uses 
TIdHttpClient.Post (with SSL), in that once in a while, while a user's ISP 
is having connectivity issues, the ReadTimeout does not seem to work 
correctly, and a response is received after the timeout period.  My 
speculation is that the reply dribbles in, and that the ReadTimeout is 
satisfied when part of the reply is received, but the entire reply is not 
received until the timeout period has passed.  Example, timeout set to 45 
seconds, reply comes in at 80 seconds.  This caused us lots of problems 
because the timeout is built around a parent process with a longer timeout 
and we end up with systems that are out of sync.  The parent process 
thinking the first timed out and the first process with a valid (although 
late) reply.  Most of the time when we have a connectivity issue, the 
ReadTimeout works properly, just not always.

We are using Indy 9.0.14.  Other constraints - we have to use the Post 
method, SSL, and embed control characters in the request (All 3rd party 
constraints - not my choice!).

Thanks for any ideas or solutions tothis problem.

Doug


Here are relavant parts of the code:

MyHttpClient  := TIdHTTP.Create(MyhttpClient); //Create Indy Client Socket
MySSLIOHandler1 := TIdSSLIOHandlerSocket.Create(nil);
RequestTStringStream := TStringStream.Create(S);

MySSLIOHandler1.SSLOptions.Method := sslvSSLv23;
MyhttpClient.Port := 443;
MyhttpClient.IOHandler := IndySSLIOHandler1;
MyhttpClient.ReadTimeout := 4500;
MyhttpClient.CheckForDisconnect(False, True);

MyhttpClient.Request.CacheControl := 'no-cache';
MyhttpClient.HTTPOptions := [hoForceEncodeParams];
MyhttpClient.Request.ContentLength := Length(RequestString);

// had to use TStringStream cuz Indy will not remove ctrl characters with 
StringStream
RequestTStringStream.WriteString(RequestString);
try
  ReplyString := MyhttpClient.Post(HostAddress, RequestTStringStream);
except
  on EIdReadTimeout do
  begin
      // perform TimeOutReversal of transaction...
      // & other steps...
  end;
end; 


5.Indy 10: IdCoderTNEF.pas bug report

Team Indy,

The very useful IdCoderTNEF.pas appears to have a bug on line 1892:

  //LVal is now the days since 1/1/1601.  Subtract Delphi's 300-year
offset...
    Result := LVal;
  * Result := Result + StrToDate('01/01/1601');  {Do not localize} 

This does not work if your Windows date format is non-standard. Should
this not be?:

    Result := LVal;
    Result := Result + EncodeDate(1601, 1, 1);  {Do not localize}

Or, simply use -109205?


Regards,
Keith

6. Fix for DateTime Bug in Indy 10 in D2006

7. Bug Fix for Indy 9.0.14 - TIdPeerThread.Data destruction order

8. FIX BUG IE7 Address Bar Not Working



Return to delphi

 

Who is online

Users browsing this forum: No registered users and 35 guest