Re: Replace gethostbyname with getaddrinfo

Mike Aubury <[email protected]> Sun, 30 Jul 2023 12:06:42 +0100
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <CAGAq4WGpRFr7QKeAgDj+9gaEa64ye5oUHj8RJ4UX1PNs7dcSsg@mail.gmail.com>
--===============5646355075634145790==
Content-Type: multipart/alternative; boundary="000000000000bc38da0601b24f08"

--000000000000bc38da0601b24f08
Content-Type: text/plain; charset="UTF-8"

Fails to compile for me :

gmake[4]: Entering directory
'/home/aubit4gl/svn/aubit4gl-aubit4gl_code/aubit4glsrc/trunk/lib/libui/ui_xml/uilib'
gcc  -Wall -Wredundant-decls -Wmissing-declarations -Wmissing-prototypes
-Wstrict-prototypes -g -g  -fPIC -DPIC -DSRC_TREE -DDEBUG -DHAVE_CONFIG_H=
-I/home/aubit4gl/aubit4glsrc/incl -I/home/aubit4gl/aubit4glsrc  -fPIC -DPIC
-I../../../../lib/libui/ui_xml -I../../../../lib/libui/ui_xml/uilib
-I../../../../lib/libui/ui_xml/uilib/aubit4gl -Wall -Ixml   -c -o comms.o
comms.c
comms.c: In function 'atoaddr':
comms.c:117:35: error: 'struct in_addr' has no member named 'sin_addr'
       struct in_addr *addr = &(ipv->sin_addr);
                                   ^
comms.c:101:33: warning: unused variable 'p' [-Wunused-variable]
   struct addrinfo hints, *res, *p;



(i'm running a fairly old version of ubuntu)

On Thu, 27 Jul 2023 at 17:24, Benson Muite <[email protected]>
wrote:

> On 7/13/23 16:48, Benson Muite wrote:
> > On 7/13/23 16:37, Mike Aubury wrote:
> >> If you can do a patch, I'd be happy to apply it - I dont think those
> >> functions will be called by the vast majority of users.
> >>
> > Will send a patch
> Initial patch is attached based on release 1.6.1
>
> It requests ipv4 addresses, though one can later update to using both
> ipv4 and ipv6 addresses
> >> If you want - I can give you developer access and you can update
> >> whatever you want :)
> >>
> > Thanks. May need to review my changes though.
> >> On Thu, 13 Jul 2023 at 14:21, Benson Muite <[email protected]
> >> <mailto:[email protected]>> wrote:
> >>
> >>     The files:
> >>     lib/libaubit4gl/gui.c
> >>     lib/libui/ui_json/uilib/comms.c
> >>     lib/libui/ui_xml/uilib/comms.c
> >>     lib/libui/ui_highlevel/remote_client/pipeclient.c
> >>
> >>     contain gethostbyname, would it be possible to replace this with
> >>     getaddrinfo?
> >>
> >>     Configure script will also need to be updated accordingly.  Can
> send a
> >>     patch with a possible implementation if it would be considered.
> >>
> >>
> _______________________________________________
> Aubit4gl-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>

--000000000000bc38da0601b24f08
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Fails to compile for me :=C2=A0<div><br></div><div>gmake[4=
]: Entering directory &#39;/home/aubit4gl/svn/aubit4gl-aubit4gl_code/aubit4=
glsrc/trunk/lib/libui/ui_xml/uilib&#39;<br>gcc =C2=A0-Wall -Wredundant-decl=
s -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -g -g =C2=
=A0-fPIC -DPIC -DSRC_TREE -DDEBUG -DHAVE_CONFIG_H=3D -I/home/aubit4gl/aubit=
4glsrc/incl -I/home/aubit4gl/aubit4glsrc =C2=A0-fPIC -DPIC -I../../../../li=
b/libui/ui_xml -I../../../../lib/libui/ui_xml/uilib -I../../../../lib/libui=
/ui_xml/uilib/aubit4gl -Wall -Ixml =C2=A0 -c -o comms.o comms.c<br>comms.c:=
 In function &#39;atoaddr&#39;:<br>comms.c:117:35: error: &#39;struct in_ad=
dr&#39; has no member named &#39;sin_addr&#39;<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0struct in_addr *addr =3D &amp;(ipv-&gt;sin_addr);<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^<br>comms.c:101:33: warning: unused vari=
able &#39;p&#39; [-Wunused-variable]<br>=C2=A0 =C2=A0struct addrinfo hints,=
 *res, *p;<br></div><div><br></div><div><br></div><div><br></div><div>(i&#3=
9;m running a fairly old version of ubuntu)</div></div><br><div class=3D"gm=
ail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, 27 Jul 2023 at 17:=
24, Benson Muite &lt;<a href=3D"mailto:[email protected]">benson_m=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote=
" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);=
padding-left:1ex">On 7/13/23 16:48, Benson Muite wrote:<br>
&gt; On 7/13/23 16:37, Mike Aubury wrote:<br>
&gt;&gt; If you can do a patch, I&#39;d be happy to apply it - I dont think=
 those<br>
&gt;&gt; functions will be called by the vast majority of users.<br>
&gt;&gt;<br>
&gt; Will send a patch<br>
Initial patch is attached based on release 1.6.1<br>
<br>
It requests ipv4 addresses, though one can later update to using both<br>
ipv4 and ipv6 addresses<br>
&gt;&gt; If you want - I can give you developer access and you can update<b=
r>
&gt;&gt; whatever you want :)<br>
&gt;&gt;<br>
&gt; Thanks. May need to review my changes though.<br>
&gt;&gt; On Thu, 13 Jul 2023 at 14:21, Benson Muite &lt;<a href=3D"mailto:b=
[email protected]" target=3D"_blank">[email protected]</a>=
<br>
&gt;&gt; &lt;mailto:<a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a>&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0The files:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0lib/libaubit4gl/gui.c<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0lib/libui/ui_json/uilib/comms.c<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0lib/libui/ui_xml/uilib/comms.c<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0lib/libui/ui_highlevel/remote_client/pipeclient=
.c<br>
&gt;&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0contain gethostbyname, would it be possible to =
replace this with<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0getaddrinfo?<br>
&gt;&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0Configure script will also need to be updated a=
ccordingly.=C2=A0 Can send a<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0patch with a possible implementation if it woul=
d be considered.<br>
&gt;&gt;<br>
&gt;&gt;<br>
_______________________________________________<br>
Aubit4gl-discuss mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank"=
>[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss" r=
el=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/lis=
tinfo/aubit4gl-discuss</a><br>
</blockquote></div>

--000000000000bc38da0601b24f08--


--===============5646355075634145790==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============5646355075634145790==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss

--===============5646355075634145790==--