Re: Replace gethostbyname with getaddrinfo
Mike Aubury <[email protected]> Wed, 16 Aug 2023 13:51:47 +0100
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <CAGAq4WFTkFvDzi2Q+-18ohZbnd0icxUYw8vKN9HR67zskkZ_rQ@mail.gmail.com> |
--===============0477327982836764974== Content-Type: multipart/alternative; boundary="000000000000d73944060309c2c8" --000000000000d73944060309c2c8 Content-Type: text/plain; charset="UTF-8" That seems to work, so I've applied it and committed to SVN. On Tue, 8 Aug 2023 at 13:25, Benson Muite <[email protected]> wrote: > Sorry, should be s_addr > > Should I create a separate branch in subversion? > > On 7/30/23 14:06, Mike Aubury wrote: > > 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] > > <mailto:[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]> > > >> <mailto:[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] > > <mailto:[email protected]> > > https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss > > <https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss> > > > _______________________________________________ > Aubit4gl-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss > --000000000000d73944060309c2c8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">That seems to work, so I've applied it and committed= =C2=A0to SVN.</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D= "gmail_attr">On Tue, 8 Aug 2023 at 13:25, Benson Muite <<a href=3D"mailt= o:[email protected]">[email protected]</a>> wrote:<br>= </div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b= order-left:1px solid rgb(204,204,204);padding-left:1ex">Sorry, should be s_= addr<br> <br> Should I create a separate branch in subversion?<br> <br> On 7/30/23 14:06, Mike Aubury wrote:<br> > Fails to compile for me :=C2=A0<br> > <br> > gmake[4]: Entering directory<br> > '/home/aubit4gl/svn/aubit4gl-aubit4gl_code/aubit4glsrc/trunk/lib/l= ibui/ui_xml/uilib'<br> > gcc =C2=A0-Wall -Wredundant-decls -Wmissing-declarations -Wmissing-pro= totypes<br> > -Wstrict-prototypes -g -g =C2=A0-fPIC -DPIC -DSRC_TREE -DDEBUG<br> > -DHAVE_CONFIG_H=3D -I/home/aubit4gl/aubit4glsrc/incl<br> > -I/home/aubit4gl/aubit4glsrc =C2=A0-fPIC -DPIC -I../../../../lib/libui= /ui_xml<br> > -I../../../../lib/libui/ui_xml/uilib<br> > -I../../../../lib/libui/ui_xml/uilib/aubit4gl -Wall -Ixml =C2=A0 -c -o= <br> > comms.o comms.c<br> > comms.c: In function 'atoaddr':<br> > comms.c:117:35: error: 'struct in_addr' has no member named &#= 39;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 variable 'p' [-Wunused-variabl= e]<br> > =C2=A0 =C2=A0struct addrinfo hints, *res, *p;<br> > <br> > <br> > <br> > (i'm running a fairly old version of ubuntu)<br> > <br> > On Thu, 27 Jul 2023 at 17:24, Benson Muite <<a href=3D"mailto:benso= [email protected]" target=3D"_blank">[email protected]</a><br> > <mailto:<a href=3D"mailto:[email protected]" target=3D"_bl= ank">[email protected]</a>>> wrote:<br> > <br> >=C2=A0 =C2=A0 =C2=A0On 7/13/23 16:48, Benson Muite wrote:<br> >=C2=A0 =C2=A0 =C2=A0> On 7/13/23 16:37, Mike Aubury wrote:<br> >=C2=A0 =C2=A0 =C2=A0>> If you can do a patch, I'd be happy to= apply it - I dont think those<br> >=C2=A0 =C2=A0 =C2=A0>> functions will be called by the vast major= ity of users.<br> >=C2=A0 =C2=A0 =C2=A0>><br> >=C2=A0 =C2=A0 =C2=A0> Will send a patch<br> >=C2=A0 =C2=A0 =C2=A0Initial patch is attached based on release 1.6.1<br= > > <br> >=C2=A0 =C2=A0 =C2=A0It requests ipv4 addresses, though one can later up= date to using both<br> >=C2=A0 =C2=A0 =C2=A0ipv4 and ipv6 addresses<br> >=C2=A0 =C2=A0 =C2=A0>> If you want - I can give you developer acc= ess and you can update<br> >=C2=A0 =C2=A0 =C2=A0>> whatever you want :)<br> >=C2=A0 =C2=A0 =C2=A0>><br> >=C2=A0 =C2=A0 =C2=A0> Thanks. May need to review my changes though.<= br> >=C2=A0 =C2=A0 =C2=A0>> On Thu, 13 Jul 2023 at 14:21, Benson Muite= <br> >=C2=A0 =C2=A0 =C2=A0<<a href=3D"mailto:[email protected]" t= arget=3D"_blank">[email protected]</a> <mailto:<a href=3D"mailt= o:[email protected]" target=3D"_blank">[email protected]<= /a>><br> >=C2=A0 =C2=A0 =C2=A0>> <mailto:<a href=3D"mailto:benson_muite@= emailplus.org" target=3D"_blank">[email protected]</a><br> >=C2=A0 =C2=A0 =C2=A0<mailto:<a href=3D"mailto:benson_muite@emailplus= .org" target=3D"_blank">[email protected]</a>>>> wrote:<b= r> >=C2=A0 =C2=A0 =C2=A0>><br> >=C2=A0 =C2=A0 =C2=A0>>=C2=A0 =C2=A0 =C2=A0The files:<br> >=C2=A0 =C2=A0 =C2=A0>>=C2=A0 =C2=A0 =C2=A0lib/libaubit4gl/gui.c<b= r> >=C2=A0 =C2=A0 =C2=A0>>=C2=A0 =C2=A0 =C2=A0lib/libui/ui_json/uilib= /comms.c<br> >=C2=A0 =C2=A0 =C2=A0>>=C2=A0 =C2=A0 =C2=A0lib/libui/ui_xml/uilib/= comms.c<br> >=C2=A0 =C2=A0 =C2=A0>>=C2=A0 =C2=A0 =C2=A0lib/libui/ui_highlevel/= remote_client/pipeclient.c<br> >=C2=A0 =C2=A0 =C2=A0>><br> >=C2=A0 =C2=A0 =C2=A0>>=C2=A0 =C2=A0 =C2=A0contain gethostbyname, = would it be possible to replace this with<br> >=C2=A0 =C2=A0 =C2=A0>>=C2=A0 =C2=A0 =C2=A0getaddrinfo?<br> >=C2=A0 =C2=A0 =C2=A0>><br> >=C2=A0 =C2=A0 =C2=A0>>=C2=A0 =C2=A0 =C2=A0Configure script will a= lso need to be updated accordingly.=C2=A0<br> >=C2=A0 =C2=A0 =C2=A0Can send a<br> >=C2=A0 =C2=A0 =C2=A0>>=C2=A0 =C2=A0 =C2=A0patch with a possible i= mplementation if it would be considered.<br> >=C2=A0 =C2=A0 =C2=A0>><br> >=C2=A0 =C2=A0 =C2=A0>><br> >=C2=A0 =C2=A0 =C2=A0_______________________________________________<br> >=C2=A0 =C2=A0 =C2=A0Aubit4gl-discuss mailing list<br> >=C2=A0 =C2=A0 =C2=A0<a href=3D"mailto:[email protected]= e.net" target=3D"_blank">[email protected]</a><br> >=C2=A0 =C2=A0 =C2=A0<mailto:<a href=3D"mailto:Aubit4gl-discuss@lists= .sourceforge.net" target=3D"_blank">[email protected]<= /a>><br> >=C2=A0 =C2=A0 =C2=A0<a href=3D"https://lists.sourceforge.net/lists/list= info/aubit4gl-discuss" rel=3D"noreferrer" target=3D"_blank">https://lists.s= ourceforge.net/lists/listinfo/aubit4gl-discuss</a><br> >=C2=A0 =C2=A0 =C2=A0<<a href=3D"https://lists.sourceforge.net/lists/= listinfo/aubit4gl-discuss" rel=3D"noreferrer" target=3D"_blank">https://lis= ts.sourceforge.net/lists/listinfo/aubit4gl-discuss</a>><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> --000000000000d73944060309c2c8-- --===============0477327982836764974== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============0477327982836764974== 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 --===============0477327982836764974==--