Re: [twsocket] THttpCli and redirected links bug - continued

2005-09-28 Thread Merijn Terheggen
I experienced the same RequestDone error and asked about it previously. I
handled it by checking de StatusCode. On a RequestDone with StatusCode = 0,
it's not the final one and more will follow. However, I seem to end up with
clients that never generate a RequestDone anymore... That means clients that
never finish, which stalls the complete download process.

I hope we can start the discussion again. Thanks.

--Merijn

Btw, I use C++ builder 6 too... Is this a builder-specific bug?

On 9/28/05, Bjørnar Nielsen [EMAIL PROTECTED] wrote:

 First, i have not read the messages you write this follow up to.

  This is a follow up. I wanted to report what appears to be a
  related issue to the bug in THttpCli when a link is
  redirected. It seems that the RequestDone is called twice.
  This has already been reported and I've implemented a work
  around in my program.

 If you get data together with the redirection, mabe it is not a bug that
 you
 get requestdone twice?

  I've discovered another issue in that it doesn't seem that
  the RcvdStream is being cleared. For example, when a link is
  requested using THttpCli and it is redirected, there can be
  garbage at the beginning of RcvdStream.
  RcvdStream should only contain the document obtained from the
  redirected link and nothing from the original link that
  caused the redirection.
 
  I am using the latest release version and C++Builder 6.
 
  I have reproduced this problem in my application using this
  link provided by a user:
  http://net1test.rhmware.com/marketingprimer
 
  I have worked around this issue by clearing RcvdStream when
  the LocationChange event is called using:
  if (HttpCli-RcvdStream) {
  HttpCli-RcvdStream-Seek(0,soFromBeginning);
  }

 If LocationChange is triggered before you have received all the data from
 first request,
 maybe you should clear the stream in requestdone instead,?

 
  By the way, I hope the above is sufficient to clear the
  stream but I'm not sure that it is. If it isn't can anyone
  state the correct way to clear/reset a steam? I can't find it
  in the documentation.

 This only sets the position in the stream, in this case to the start of
 the
 stream. Then when you receive data, the data is written from the start of
 the stream, overwriting previous data if there are any. If you use a
 TMemoryStream, you can use Clear or SetSize, this will also delete old
 data.
 You can also delete the stream and make a new stream.

 Regards Bjørnar


 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] THttpCli and redirected links bug - continued

2005-09-28 Thread Albert Wiersch

 I have worked around this issue by clearing RcvdStream when the
 LocationChange event is called using:
 if (HttpCli-RcvdStream) {
  HttpCli-RcvdStream-Seek(0,soFromBeginning);
 }
 
 By the way, I hope the above is sufficient to clear the stream but I'm
not
 sure that it is. If it isn't can anyone state the correct way to
clear/reset
 a steam? I can't find it in the documentation.
 
 In that case the best way is calling the CleanupRcvdStream method.

It's not accessible so I'm just going to use something like
   HttpCli-RcvdStream-Size=0;

 At the moment I'm busy to solve a problem with the SSL version.
 I keep this message in evidence and I'll look into this problem asap.

Thanks. Good luck. :-)

Albert

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be