Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Oct : Re: Indy TIdHTTP vs UrlDownloadToFile

www.cryer.info
Managed Newsgroup Archive

Re: Indy TIdHTTP vs UrlDownloadToFile

Subject:Re: Indy TIdHTTP vs UrlDownloadToFile
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Thu, 19 Oct 2006 11:33:52

"Steve" <no.spam@onbox.com> wrote in message
news:45375a87$1@newsgroups.borland.com...

> but why UrlDownloadToFile works and TIdHTTP.Get() doesn't?

There is no way to diganose that given the minimal details you have provided
so far.

> I use the same URL and the server isn't fault...

It can be.  Like I said earlier, it depends on what exactly the server is
sending in its reply.  Can you please show the actual HTTP traffic?

> It's the result of GetLastError (inside try/except), at last it's and
> Indy error

GetLastError() is not guaranteed to return a valid error code by the time an
exception handler is reached (in fact, I reported an issue to Borland awhile
back where throwing an exception clears GetLastError()).  Besides that, you
need to use WSAGetLastError(), not GetLastError(), to retreive socket error
codes.  Which Indy already does internally for you.  If the exception is an
EIdSocketError, then you can use its ErrorCode property to get the socket
error code that WSAGetLastError() returned.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive