let (address, port, path) = parse_url url in
let buf = String.create tcp_bufsiz in
let (inchan, outchan) = init_socket address port in
- output_string outchan (sprintf "GET %s HTTP/1.0\r\n\r\n" path);
+ output_string outchan (sprintf "GET %s\r\n" path);
flush outchan;
(try
while true do
close_in inchan (* close also outchan, same fd *)
let wget ?output url =
+ debug_print
+ (sprintf "wgetting %s (output: %s)" url
+ (match output with None -> "default" | Some f -> f));
match url with
| url when Pcre.pmatch ~rex:file_scheme_RE url -> (* file:// *)
(let src_fname = Pcre.replace ~rex:file_scheme_RE url in