635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
|
if (hostname_utf8_length_processed != hostname_utf8_length) {
Tcl_SetResult(interp, "Failed to convert entire buffer", NULL);
return(TCL_ERROR);
}
gai_ret = getaddrinfo(hostname, NULL, NULL, &gai_data);
if (gai_ret == EAI_NODATA || gai_ret == EAI_NONAME) {
Tcl_SetResult(interp, "", NULL);
return(TCL_OK);
}
if (gai_ret != 0) {
Tcl_SetResult(interp, (char *) gai_strerror(gai_ret), NULL);
return(TCL_ERROR);
}
list_of_hostnames = Tcl_NewObj();
for (addr_current = gai_data; addr_current; addr_current = addr_current->ai_next) {
if (addr_current->ai_family != AF_INET && addr_current->ai_family != AF_INET6) {
continue;
}
|
|
<
<
<
<
<
|
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
|
if (hostname_utf8_length_processed != hostname_utf8_length) {
Tcl_SetResult(interp, "Failed to convert entire buffer", NULL);
return(TCL_ERROR);
}
gai_ret = getaddrinfo(hostname, NULL, NULL, &gai_data);
if (gai_ret != 0) {
Tcl_SetResult(interp, "", NULL);
return(TCL_OK);
}
list_of_hostnames = Tcl_NewObj();
for (addr_current = gai_data; addr_current; addr_current = addr_current->ai_next) {
if (addr_current->ai_family != AF_INET && addr_current->ai_family != AF_INET6) {
continue;
}
|