Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jul : possible bug in Indy, TidHttp

www.cryer.info
Managed Newsgroup Archive

possible bug in Indy, TidHttp

Subject:possible bug in Indy, TidHttp
Posted by:"dk_sz" (dk_..@hotmail.com)
Date:Fri, 7 Jul 2006 01:50:50

Hi... I get an endless loop here when connecting
to a website that requires authentication...
IF I do not have the correct username/password.


idHttp, line ~1420
function TIdCustomHTTP.DoOnAuthorization(ARequest: TIdHTTPRequest;
AResponse: TIdHTTPResponse): Boolean;
"
    repeat
      case ARequest.Authentication.Next of
        wnAskTheProgram:
          begin // Ask the user porgram to supply us with authorization
information
            if Assigned(FOnAuthorization) then
            begin
              ARequest.Authentication.UserName := ARequest.Username;
              ARequest.Authentication.Password := ARequest.Password;

              OnAuthorization(self, ARequest.Authentication, result);

              if result then begin
                ARequest.BasicAuthentication := true;
                ARequest.Username := ARequest.Authentication.UserName;
                ARequest.Password := ARequest.Authentication.Password;
              end
              else begin
                break;
              end;
            end;
          end;
"

Well, you guess it, I have my own even handler... It looks like this:
"
  if FHTTP.AuthRetries <= FHTTP.MaxAuthRetries then
    begin
      Authentication.Username := FAuthUsernameBD;
      Authentication.Password := FAuthPasswordBD;
      Handled := True;
    end
  else
    begin
      Handled := False;
    end
  ;
"


Problem?  FHTTP.AuthRetries never changes!
*Repeat* just loops again and...Is this behavior as
intended? Just wondering... Just seems slightly weird...?


best regards
Thomas Schulz

Replies:

www.cryer.info
Managed Newsgroup Archive