ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/sockinfo.C
(Generate patch)

Comparing gvpe/src/sockinfo.C (file contents):
Revision 1.29 by root, Tue Dec 4 13:49:16 2012 UTC vs.
Revision 1.30 by root, Tue Dec 4 13:51:45 2012 UTC

70 { 70 {
71 struct in_addr in; 71 struct in_addr in;
72 struct hostent *he; 72 struct hostent *he;
73 73
74 if (inet_aton (hostname, &in)) 74 if (inet_aton (hostname, &in))
75 {
76 host = in.s_addr; 75 host = in.s_addr;
77 }
78 else if ((he = gethostbyname (hostname)) 76 else if ((he = gethostbyname (hostname))
79 && he->h_addrtype == AF_INET 77 && he->h_addrtype == AF_INET
80 && he->h_length == 4 78 && he->h_length == 4
81 && he->h_addr_list[0]) 79 && he->h_addr_list[0])
82 { 80 memcpy (&host, he->h_addr_list[0], 4); //sa->sin_family = he->h_addrtype;
83 //sa->sin_family = he->h_addrtype;
84 memcpy (&host, he->h_addr_list[0], 4);
85 }
86 else 81 else
87 slog (L_NOTICE, _("unable to resolve host '%s'"), hostname); 82 slog (L_NOTICE, _("unable to resolve host '%s'"), hostname);
88 } 83 }
89} 84}
90 85

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines