(
name: PyUtf8StrRef,
vm: &VirtualMachine,
)
| 2943 | |
| 2944 | #[pyfunction] |
| 2945 | fn gethostbyname_ex( |
| 2946 | name: PyUtf8StrRef, |
| 2947 | vm: &VirtualMachine, |
| 2948 | ) -> Result<(String, PyListRef, PyListRef), IoOrPyException> { |
| 2949 | let addr = get_addr(vm, name, c::AF_INET)?; |
| 2950 | let (hostname, _) = dns_lookup::getnameinfo(&addr, 0) |
| 2951 | .map_err(|e| convert_socket_error(vm, e, SocketError::HError))?; |
| 2952 | Ok(( |
| 2953 | hostname, |
| 2954 | vm.ctx.new_list(vec![]), |
| 2955 | vm.ctx |
| 2956 | .new_list(vec![vm.ctx.new_str(addr.ip().to_string()).into()]), |
| 2957 | )) |
| 2958 | } |
| 2959 | |
| 2960 | #[pyfunction] |
| 2961 | fn inet_pton(af_inet: i32, ip_string: PyUtf8StrRef, vm: &VirtualMachine) -> PyResult<Vec<u8>> { |
nothing calls this directly
no test coverage detected