On Thu, 2008-06-12 at 15:22 +0800, Jeff Cai wrote:
> Shuai has found the problem that evolution can not display remote image.
> 
> 
> It is all because of getAddrinfo();  
> 
> int getaddrinfo(const char *nodename, const char *servname,
>          const struct addrinfo *hints, struct addrinfo **res);
> 
> If I call this function in solaris as below:
> 
> getaddrinfo( "www.msuniversity.edu.cn", "http", &hints, &result );
> 
> Solaris will return error.
> 
> However, linux will work well if getaddrinfo( "www.msuniversity.edu.cn",
> "http", &hints, &result );
> 
> 
> If I use as 
> getaddrinfo( "www.msuniversity.edu.cn", "80", &hints, &result );
> 
> Then both solaris and linux will work right.

Right, using "http" assumes that there is a naming service that can
resolve "http" to port "80".  "http" may not be in /etc/services, which
is where getaddrinfo() gets its port information.  It is indeed safer to
use the port number, but there is also no excuse for Solaris to not have
"http" in /etc/services by default.  I'll file a separate bug for that
against Solaris.

Thanks!
-Seb



Reply via email to