Browse Source

* ip6test errorhandling fix + parameters. (trying to reproduce mantis 4867)

git-svn-id: trunk@14957 -
marco 15 years ago
parent
commit
1f1e7578c9
1 changed files with 14 additions and 1 deletions
  1. 14 1
      packages/fcl-net/examples/ip6test.pp

+ 14 - 1
packages/fcl-net/examples/ip6test.pp

@@ -14,10 +14,23 @@ var
   i: integer;
   t1,t2:text;
   x: array of thostaddr6;
+  hname : string;
+
+Const
+  ip6hosttest = 'whatismyv6.com';
 
 begin
+  hname:=ip6hosttest;
+  if paramcount>0 then
+    hname:=paramstr(1);
   setlength(x, 100);
-  setlength(x,resolvename6('whatismyv6.com', x));
+  i:=resolvename6(hname, x);
+  if i=-1 then
+    begin
+      writeln('Domain not found, ',hname);
+      halt;
+    end;
+  setlength(x,i);
   if length(x) = 0 then halt(2);
   with dest do begin
     sin6_family := PF_INET6;