X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Focaml-http%2Fhttp_misc.ml;h=fcec70ca5f4016523fca8e8bf757aa4e4f045cee;hb=3bb4ce11fb9d4c6375483a80344beb94c4517dd7;hp=191508c49a01cb8e9e96f88482db96f17dac8090;hpb=ca9cd0aeee0ce78a891f7f6091ca8704231a446d;p=helm.git diff --git a/helm/DEVEL/ocaml-http/http_misc.ml b/helm/DEVEL/ocaml-http/http_misc.ml index 191508c49..fcec70ca5 100644 --- a/helm/DEVEL/ocaml-http/http_misc.ml +++ b/helm/DEVEL/ocaml-http/http_misc.ml @@ -2,7 +2,7 @@ (* OCaml HTTP - do it yourself (fully OCaml) HTTP daemon - Copyright (C) <2002> Stefano Zacchiroli + Copyright (C) <2002-2004> Stefano Zacchiroli This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -98,7 +98,9 @@ let reason_phrase_of_code = function | invalid_code -> raise (Invalid_code invalid_code) let build_sockaddr (addr, port) = - Unix.ADDR_INET (Unix.inet_addr_of_string addr, port) + try + Unix.ADDR_INET ((Unix.gethostbyname addr).Unix.h_addr_list.(0), port) + with Not_found -> failwith ("OCaml-HTTP, can't resolve hostname: " ^ addr) let explode_sockaddr = function | Unix.ADDR_INET (addr, port) -> (Unix.string_of_inet_addr addr, port)