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 '/home/aubit4gl/svn/aubit4gl-aubit4gl_code/aubit4=
glsrc/trunk/lib/libui/ui_xml/uilib'<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 'atoaddr':<br>comms.c:117:35: error: 'struct in_ad=
dr' has no member named 'sin_addr'<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0struct in_addr *addr =3D &(ipv->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 'p' [-Wunused-variable]<br>=C2=A0 =C2=A0struct addrinfo hints,=
*res, *p;<br></div><div><br></div><div><br></div><div><br></div><div>(i=
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 <<a href=3D"mailto:[email protected]">benson_m=
[email protected]</a>> 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>
> On 7/13/23 16:37, Mike Aubury wrote:<br>
>> If you can do a patch, I'd be happy to apply it - I dont think=
those<br>
>> functions will be called by the vast majority of users.<br>
>><br>
> 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>
>> If you want - I can give you developer access and you can update<b=
r>
>> whatever you want :)<br>
>><br>
> Thanks. May need to review my changes though.<br>
>> On Thu, 13 Jul 2023 at 14:21, Benson Muite <<a href=3D"mailto:b=
[email protected]" target=3D"_blank">[email protected]</a>=
<br>
>> <mailto:<a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a>>> wrote:<br>
>><br>
>>=C2=A0 =C2=A0 =C2=A0The files:<br>
>>=C2=A0 =C2=A0 =C2=A0lib/libaubit4gl/gui.c<br>
>>=C2=A0 =C2=A0 =C2=A0lib/libui/ui_json/uilib/comms.c<br>
>>=C2=A0 =C2=A0 =C2=A0lib/libui/ui_xml/uilib/comms.c<br>
>>=C2=A0 =C2=A0 =C2=A0lib/libui/ui_highlevel/remote_client/pipeclient=
.c<br>
>><br>
>>=C2=A0 =C2=A0 =C2=A0contain gethostbyname, would it be possible to =
replace this with<br>
>>=C2=A0 =C2=A0 =C2=A0getaddrinfo?<br>
>><br>
>>=C2=A0 =C2=A0 =C2=A0Configure script will also need to be updated a=
ccordingly.=C2=A0 Can send a<br>
>>=C2=A0 =C2=A0 =C2=A0patch with a possible implementation if it woul=
d be considered.<br>
>><br>
>><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==--