Einzelnen Beitrag anzeigen

mocition

Registriert seit: 20. Nov 2012
16 Beiträge
 
#2

AW: idHTTP.Post hängt sich auf

  Alt 9. Jan 2013, 10:13
Ich habe jetzt Projekt->Optionen bei "Compilieren" die Option "Mit Debug-DCUs" auf True gesetzt und jetzt läuft es!
Wie es ausschaut ist das Problem bei idIOHandler.pas bei der TIdIOHandler.DiscardAll aufgetreten:
Code:
procedure TIdIOHandler.DiscardAll;
begin
  BeginWork(wmRead);
  try
    // If data already exists in the buffer, discard it first.
    FInputBuffer.Clear;
    // RLebeau - don't call Connected() here!  ReadBytes() already
    // does that internally. Calling Connected() here can cause an
    // EIdConnClosedGracefully exception that breaks the loop
    // prematurely and thus leave unread bytes in the InputBuffer.
    // Let the loop catch the exception before exiting...
    repeat
                                                                       
      try
        if ReadFromSource(False) > 0 then begin
          FInputBuffer.Clear;
        end else begin;
          CheckForDisconnect(True, True);
        end;
      except
        on E: Exception do begin
          // RLebeau - ReadFromSource() could have filled the
          // InputBuffer with more bytes...
          FInputBuffer.Clear;
          if E is EIdConnClosedGracefully then begin
            Break;
          end else begin
            raise;
          end;
        end;
      end;
      TIdAntiFreezeBase.DoProcess;
    until False;
  finally
    EndWork(wmRead);
  end;
end;
  Mit Zitat antworten Zitat