[twsocket] Tr: HTTPProt bug report.

Francois PIETTE francois.piette@pophost.eunet.be
Tue, 6 Jun 2000 20:08:14 +0200


----- Original Message -----
From: Eran More <eran@udssoft.com>
To: <francois.piette@rtfm.be>
Cc: <francois.piette@pophost.eunet.be>
Sent: Tuesday, June 06, 2000 1:46 PM
Subject: HTTPProt bug report.


> Hello,
>
> I have been trying out your component, it works fine, I think I have found
a
> bug?
> I have sent you the modified event, with one additional line (marked).
>
> The bug is that it got "stuck" in multiple "Post" requests (since the
Stream
> was not reset), but after adding this line, things work well.
>
> Please reply if you agree.
>
> Modified code:
> ~~~~~~~~~~~~~~~~~~~~
> procedure THttpCli.SocketDataSent(Sender : TObject; Error : Word);
> var
>     Len : Integer;
> begin
>     if not FAllowedToSend then
>         Exit;
>
>     Len := FSendStream.Read(FSendBuffer, sizeof(FSendBuffer));
>     if Len <= 0 then begin
>         FAllowedToSend := FALSE;
>         TriggerSendEnd;
>         FSendStream.Position := 0; <<<<<<<-----------
>         Exit;
>     end;
>
>     if Len > 0 then begin
>         FSentCount := FSentCount + Len;
>         TriggerSendData(@FSendBuffer, Len);
>         FWSocket.Send(@FSendBuffer, Len);
>     end;
> end;
>
> Good luck.
> Eran.
> eran_m@phantom2.com
>
>
>