Loki,
Oddly enough this thread goes all the way back to April of 2003 See:
(http://groups.yahoo.com/group/Hermes-Server/message/396). Eventually I
found the same problem you did (See:
http://groups.yahoo.com/group/Hermes-Server/message/443). The problem as
best I can tell is that reading the NameServer value from they key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters,
is formatted differently on various versions of windows. On some
systems, it is comma delimited, and on others space delimited. So I good
fix would work for both (I see that your code replaces, then separates
so that should work. Thats actually what I proposed be done when it was
first found. Looking at the code you posted, it seems that it never
really got fixed. One thing that I have noticed is that the only people
that ever reported having the problem, you and I, were running on NT4 so
it seems that this is one version of windows that is affected.
I've long since upgraded from NT4 on that machine, and I would guess
most other Hermes users have also. I suspect very few people get
affected by this. I also stopped running my own mail server since most
big American ISPs started blacklisting Dynamic IP's, but I'm still a fan
of Hermes!
-Will
> Date: Wed, 03 May 2006 00:13:39 -0000
> From: "David" <lokisemail@...>
> Subject: Re: Can't Open Console
>
> Though I should post a fix for this in case no one else had
>
> The bug is in
> UtilU1.pas
> lines 484-487
>
> It is trying to fill DNSList from a comma or space separated list of
> ips, but if the delimiter is a space, it never reduces the source
> list, so it continually adds to DNSList
>
>
>
> procedure FetchDNSList(DNSList : TStringList);
> var
> Reg : TRegistry;
> tempStr : String;
> begin
> if Assigned(DNSList) then begin
> DNSList.Clear;
>
> Reg := TRegistry.Create;
> Reg.RootKey := HKEY_LOCAL_MACHINE;
>
> if
> Reg.OpenKey('System\CurrentControlSet\Services\Tcpip\Parameters',
> False) then begin
>
> // Read Static Name Servers...
> tempStr := Reg.ReadString('NameServer');
> if tempStr <> '' then begin
> // ************** Bug starts here
>
> while (Pos(',', tempStr) <> 0) or (Pos(' ', tempStr) <> 0) do
> begin
> DNSList.Add(Trim( Copy(tempStr, 1, Pos(',', tempStr)-1) ));
> tempStr := Copy(tempStr, Pos(',', tempStr)+1, Length(tempStr) );
> end;
> // ************** Bug ends here
> DNSList.Add( tempStr );
> end;
>
> // Read DHCP Name Servers...
> tempStr := Reg.ReadString('DHCPNameServer');
> if tempStr <> '' then begin
> while Pos(' ', tempStr) <> 0 do begin
> DNSList.Add(Trim( Copy(tempStr, 1, Pos(' ', tempStr)-1) ));
> tempStr := Copy(tempStr, Pos(' ', tempStr)+1, Length(tempStr) );
> end;
> DNSList.Add( tempStr );
> end;
> end;
> Reg.Free;
> end;
> end;
>
>
> 1 solution is to replace the function with the following :-
>
> tempStr := Reg.ReadString('DHCPNameServer');
> if tempStr <> '' then begin
> while Pos(' ', tempStr) <> 0 do begin
>
> with
>
> tempStr := StringReplace(Reg.ReadString('NameServer'), ' ', ',',
> [rfReplaceAll]);
> if tempStr <> '' then begin
> while (Pos(',', tempStr) <> 0) do begin
>
>
>
> Regards, Loki
>
>