Board index » delphi » TIdICMPClient bug

TIdICMPClient bug

There must be something wrong here, or half the code is useless:

procedure TIdIcmpClient.DecodeResponse(BytesRead: integer);
var
  pip: PIdIPHdr;
  picmp: PIdICMPHdr;
  iIpHeaderLen: integer;
begin
  pip := @bufReceive;
  iIpHeaderLen := (pip^.ip_verlen and $0F) * 4;
  if (BytesRead < iIpHeaderLen + ICMP_MIN) then
    raise EIdIcmpException.Create('Not enough bytes received');

  picmp := @bufReceive[iIpHeaderLen + 1];
// ???******isn't some IF statement missing here******???
    raise EIdICMPException.Create('Non-echo type response received');
// this is *always* executed so *all* code below *never* gets executed

[...snip...]
end;

johannes
--
Please reply in this newsgroup only
 - SIP solutions -
http://www.sipsolutions.de/

 

Re:TIdICMPClient bug


Quote
"Johannes Berg" <johannes.berg.n...@gmx.net> wrote in message

news:397B6A44.96D72739@gmx.net...

Quote
> There must be something wrong here, or half the code is useless:

nice one!

Ian

Re:TIdICMPClient bug


Quote
> nice one!

Even Delphi found it! ;-)
"Warning: Value assigned to picmp is never used."
(or is it a hint?)

johannes
--
Please reply in this newsgroup only
 - SIP solutions -
http://www.sipsolutions.de/

Re:TIdICMPClient bug


johannes.berg.n...@gmx.net (Johannes Berg) wrote in
<397B9952.23FD3...@gmx.net>:

Quote
>Even Delphi found it! ;-)
>"Warning: Value assigned to picmp is never used."
>(or is it a hint?)

:)

Got hte bug report, and its been forwarded.

--
Chad Z. Hower (Kudzu) - Church Hill, TN - Nevrona Designs / Team Winshoes
          "Programming is an art form that fights back"
Forget the Y2K problem, Lets fix the W2K problem. (I suggest Linux)
http://www.pbe.com/Kudzu/ - Free Delphi/CBuilder components and articles
http://www.pbe.com/Kudzu/Internet/ - Everything Internet for Delphi / CB

Re:TIdICMPClient bug


Kudzu, you are amazing. You sleep less that I do!

Ian

Re:TIdICMPClient bug


Someone was a bit overzealed with removing internal comments :)

the line sould read:

  if not (picmp^.icmp_type in [Id_ICMP_ECHO, Id_ICMP_ECHOREPLY]) then
    raise EIdICMPException.Create('Non-echo type response received');

You can correct it locally if you want but it has been fixed in the source.

Good luck,
Stephane

On 23 Jul 2000, johannes.berg.n...@gmx.net (Johannes Berg) wrote in
<397B6A44.96D72...@gmx.net>:

Quote
>There must be something wrong here, or half the code is useless:

>procedure TIdIcmpClient.DecodeResponse(BytesRead: integer);
>var
>  pip: PIdIPHdr;
>  picmp: PIdICMPHdr;
>  iIpHeaderLen: integer;
>begin
>  pip := @bufReceive;
>  iIpHeaderLen := (pip^.ip_verlen and $0F) * 4;
>  if (BytesRead < iIpHeaderLen + ICMP_MIN) then
>    raise EIdIcmpException.Create('Not enough bytes received');

>  picmp := @bufReceive[iIpHeaderLen + 1];
>// ???******isn't some IF statement missing here******???
>    raise EIdICMPException.Create('Non-echo type response received');
>// this is *always* executed so *all* code below *never* gets executed

>[...snip...]
>end;

>johannes

Re:TIdICMPClient bug


Quote
> You can correct it locally if you want but it has been fixed in the source.

Does this mean if I re-download the source now, I have all the fixes
incorporated? I'm just curious, I made a bunch of changes (including one that
was not official so I don't know if that problem still persists in the
original source)..
Is there any way to find out the bug status for a particular bug? [In this
case I'm interested in the "AV on destroy listener when client still
connected" bug]

johannes
--
Please reply in this newsgroup only
 - SIP solutions -
http://www.sipsolutions.de/

Re:TIdICMPClient bug


johannes.berg.n...@gmx.net (Johannes Berg) wrote in
<397C054B.493FC...@gmx.net>:

Quote
>Does this mean if I re-download the source now, I have all the fixes
>incorporated?

Not until the next release.

Quote
>Is there any way to find out the bug status for a particular bug? [In
>this case I'm interested in the "AV on destroy listener when client
>still connected" bug]

THe AV on destroy, still being looked at.
--
Hadi Hariri
http://delphi.urusoft.com

Re:TIdICMPClient bug


ian.stu...@chelloNOSPAM.at (Ian Stuart) wrote in <8lgh8s$kdn1
@bornews.borland.com>:

Quote
>Kudzu, you are amazing. You sleep less that I do!

Sleep? Whats that?

--
Chad Z. Hower (Kudzu) - Church Hill, TN - Nevrona Designs / Team Winshoes
          "Programming is an art form that fights back"
Forget the Y2K problem, Lets fix the W2K problem. (I suggest Linux)
http://www.pbe.com/Kudzu/ - Free Delphi/CBuilder components and articles
http://www.pbe.com/Kudzu/Internet/ - Everything Internet for Delphi / CB

Re:TIdICMPClient bug


johannes.berg.n...@gmx.net (Johannes Berg) wrote in
<397C054B.493FC...@gmx.net>:

Quote
>Does this mean if I re-download the source now, I have all the fixes
>incorporated? I'm just curious, I made a bunch of changes (including one
>that was not official so I don't know if that problem still persists in
>the original source)..

No. Stepahne updated it in the VCS. I've not done a rebuild yet. I hope to in
the next few days. The build will contain many many bug fixes.

Quote
>Is there any way to find out the bug status for a particular bug? [In this
>case I'm interested in the "AV on destroy listener when client still
>connected" bug]

Ask here. We have them logged in our VCS.

--
Chad Z. Hower (Kudzu) - Church Hill, TN - Nevrona Designs / Team Winshoes
          "Programming is an art form that fights back"
Forget the Y2K problem, Lets fix the W2K problem. (I suggest Linux)
http://www.pbe.com/Kudzu/ - Free Delphi/CBuilder components and articles
http://www.pbe.com/Kudzu/Internet/ - Everything Internet for Delphi / CB

Re:TIdICMPClient bug


Quote
> Ask here. We have them logged in our VCS.

Yes, but that costs you time...

johannes
--
Please reply in this newsgroup only
 - SIP solutions -
http://www.sipsolutions.de/

Re:TIdICMPClient bug


johannes.berg.n...@gmx.net (Johannes Berg) wrote in
<397CDF24.5BC58...@gmx.net>:

Quote
>> Ask here. We have them logged in our VCS.

>Yes, but that costs you time...

Yes. Unfortunatley we dont have an automated system yet. In a few weeks maybe
we will.

--
Chad Z. Hower (Kudzu) - Church Hill, TN - Nevrona Designs / Team Winshoes
          "Programming is an art form that fights back"
Forget the Y2K problem, Lets fix the W2K problem. (I suggest Linux)
http://www.pbe.com/Kudzu/ - Free Delphi/CBuilder components and articles
http://www.pbe.com/Kudzu/Internet/ - Everything Internet for Delphi / CB

Other Threads