[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] [EXTERNAL] Re: SetError() #2: Host name look up failed



Hi David,

Thanks for the trace file.  What is happening looks like this:

1) HTTPAPI extracts the host name from your URL.  For example, if the URL contains http://www.rrd.com/test1/test2 it will extract www.rrd.com

2) HTTPAPI passes this (www.rrd.com, or whatever the name was) to the operating system function gethostbyname(). 

3) Under the covers, the operating system will query your name servers, by sending a DNS request to 10.79.131.126, 172.24.8.126 and 172.24.14.21 as configured on your system.

What's happening is that gethostbyname() is returning NULL, which means that it could not find the domain name, the servers didn't respond, or there is no address for that host name, or some similar error. 

You mentioned "The DNS answer a ping and returns the correct IP".  Can you expound on that?  Do you mean that on the command line of the same IBM i partition, you are typing PING RMTSYS('www.rrd.com') (or whatever the host name happens to be) and it's working and correctly returning the IP address of the host?

If so, I can only guess that you have some sort of a typo in the one that you are passing to HTTPAPI -- because that doesn't make much sense.  In both cases, the operating system is looking up the host name via the same underlying routine.  Why would it work from PING vs. HTTPAPI?  I can only guess there's a typo.

Or, another problem might be that the parameter list has a mismatch.  (Especially since you're using the 1980's *ENTRY PLIST syntax, which is very prone to this problem.)   Perhaps the URL is getting corrupted during parameter passing?  If you run your program in debug, immediately before calling http_url_post_raw, what is the contents of PR_Destination?

-- 
Scott Klement
sk@xxxxxxxxxxxxxxxx
On 11/24/2020 6:52 PM, David Hanneman wrote:

LIBHTTP release 1.23
Looking for some help with this error message: "SetError() #2: Host name look up failed'

The DNS answer a ping and returns the correct IP.
The trace is not showing any activity going to the destination.

I am using http_url_post_raw. I cloned EXAMPLE05 and tweaked the PARMS to it look like this:

--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi

-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi