curl-users
Re: Couldn't resolv host on HP-UX
Date: Thu, 17 Aug 2000 14:50:37 -0400
Daniel Stenberg wrote:
>
> On Thu, 17 Aug 2000, Fred Noz wrote:
>
> > I am finding this bug when running on HP-UX 10.20 and HP-UX 11 (works
> > OK on Linux) using latest curl (Aug. 16, 2000) (OK on 6.5.2):
> > On a system where DNS is used for host name resolution, the command
> > line:
> > curl http://xx.yy.zz.com/
> > results in the error message:
> > curl: (6) Couldn't resolv host 'xx.yy.zz.com'
>
> The name resolving is changed in curl 7 to use the gethostbyname_r()
> function, as opposed to the gethostbyname() in curl 6. One major problem I
> have with gethostbyname_r() is that there exists at least three different
> ways to use it, depending on what platform you use.
>
> The configure script detects gethostbyname_r() and tries to determine how
> many arguments *your* version of gethostbyname_r() should have.
>
> Could you please check how many arguments it thinks your gethostbyname_r()
> should get?
>
> Then, would you be capable of single-stepping the GetHost() function to see
> when it fails or try some alternatives until it works?
HP-UX 10.20:
The configure script thinks gethostbyname_r() function takes 5 args
when it really takes 3. It thinks gethostbyaddr_r() takes 7 args when
it takes 5. After I ran configure, I edited config.cache and changed:
< ac_cv_gethostbyaddr_args=${ac_cv_gethostbyaddr_args=7}
< ac_cv_gethostbyname_args=${ac_cv_gethostbyname_args=5}
--- > ac_cv_gethostbyaddr_args=${ac_cv_gethostbyaddr_args=5} > ac_cv_gethostbyname_args=${ac_cv_gethostbyname_args=3} Then I ran configure again. config.h now shows the correct number of args. I ran make and had a few compile errors in lib/hostip.c and lib/ftp.c. I will send the corrected files to you separately. In lib/hostip.c: Added #define _REENTRANT Changed *h_errnop= errno; to h_errnop= errno; (both are int). Commented out #include "inet_ntoa_r.h" (This caused a type conflict.) In lib/ftp.c: Unbalanced parentheses. Now curl compiles correctly. Unfortunately, I still get the same error (Couldn't resolv host). HP-UX 11: I compiled natively on HP-UX 11 and curl works perfectly (without any code changes). This version does not have gethostbyname_r() or gethostbyaddr_r(). gethostbyname() and gethostbyaddr() are both reentrant and have standard syntax. Perhaps curl does not take advantage of their reentrancy. I don't know. The configure script correctly states that gethostbyname_r() and gethostbyaddr_r() are not present. I don't have much more time to debug curl on HP-UX 10.20. I would be glad to compile and execute a quick test if you would like. - Fred NozReceived on 2000-08-17