35 |
open DriverInteractive |
open DriverInteractive |
36 |
open CommonOptions |
open CommonOptions |
37 |
|
|
38 |
|
(* prints a new logline with date, module and starts newline *) |
39 |
|
let lprintf_nl () = |
40 |
|
lprintf "%s[dCon] " |
41 |
|
(log_time ()); lprintf_nl2 |
42 |
|
|
43 |
let rec dollar_escape o with_frames s = |
let rec dollar_escape o with_frames s = |
44 |
String2.convert false (fun b escaped c -> |
String2.convert false (fun b escaped c -> |
336 |
if (List.mem tm.Unix.tm_wday days || days = []) && |
if (List.mem tm.Unix.tm_wday days || days = []) && |
337 |
(List.mem tm.Unix.tm_hour hours || hours = []) then begin |
(List.mem tm.Unix.tm_hour hours || hours = []) then begin |
338 |
eval (ref true) command calendar_options; |
eval (ref true) command calendar_options; |
339 |
lprintf "Calendar execute: %s\n%s\n" command |
lprintf_nl () "Calendar execute: %s" command; |
340 |
(Buffer.contents calendar_options.conn_buf); |
lprintf_nl () "%s" (Buffer.contents calendar_options.conn_buf); |
341 |
Buffer.clear calendar_options.conn_buf; |
Buffer.clear calendar_options.conn_buf; |
342 |
end |
end |
343 |
) !!calendar |
) !!calendar |
670 |
Unix.close s |
Unix.close s |
671 |
with |
with |
672 |
Failure mess -> |
Failure mess -> |
673 |
lprintf "%s\n" mess; |
lprintf_nl () "%s" mess; |
674 |
Unix.close s |
Unix.close s |
675 |
) |
) |
676 |
| _ -> |
| _ -> |
820 |
let ext_pos = (String.rindex filename '.') + 1 in |
let ext_pos = (String.rindex filename '.') + 1 in |
821 |
let exten = (String.sub filename ext_pos ((String.length filename) - ext_pos)) in |
let exten = (String.sub filename ext_pos ((String.length filename) - ext_pos)) in |
822 |
if !verbose_msg_servers then |
if !verbose_msg_servers then |
823 |
lprintf_nl "[HTTP]: Extension found [%s] for file: [%s]" exten filename; |
lprintf_nl () "Extension found [%s] for file: [%s]" exten filename; |
824 |
let ext = extension_to_file_ext exten in |
let ext = extension_to_file_ext exten in |
825 |
http_add_bin_header r ext clen; |
http_add_bin_header r ext clen; |
826 |
Buffer.add_string buf file_to_send |
Buffer.add_string buf file_to_send |
830 |
"jpg" -> |
"jpg" -> |
831 |
(match Autoconf.has_gd_jpg with |
(match Autoconf.has_gd_jpg with |
832 |
true -> false |
true -> false |
833 |
| false -> lprintf_nl "[HTTP] : Warning: GD jpg support disabled"; true) |
| false -> lprintf_nl () "Warning: GD jpg support disabled"; true) |
834 |
| "png" -> |
| "png" -> |
835 |
(match Autoconf.has_gd_png with |
(match Autoconf.has_gd_png with |
836 |
true -> false |
true -> false |
837 |
| false -> lprintf_nl "[HTTP] : Warning: GD png support disabled"; true) |
| false -> lprintf_nl () "Warning: GD png support disabled"; true) |
838 |
| _ -> |
| _ -> |
839 |
(match Autoconf.has_gd with |
(match Autoconf.has_gd with |
840 |
true -> false |
true -> false |
841 |
| false -> lprintf_nl "[HTTP] : Warning: GD support disabled"; true) |
| false -> lprintf_nl () "Warning: GD support disabled"; true) |
842 |
let any_ip = Ip.of_inet_addr Unix.inet_addr_any |
let any_ip = Ip.of_inet_addr Unix.inet_addr_any |
843 |
|
|
844 |
let html_open_page buf t r open_body = |
let html_open_page buf t r open_body = |
1094 |
|
|
1095 |
| "/favicon.ico" -> |
| "/favicon.ico" -> |
1096 |
if !verbose_msg_servers then |
if !verbose_msg_servers then |
1097 |
lprintf_nl "[BT]: favicon.ico request received by tracker"; |
lprintf_nl () "favicon.ico request received by tracker"; |
1098 |
http_send_bin r buf "favicon.ico" |
http_send_bin r buf "favicon.ico" |
1099 |
|
|
1100 |
| "/filter" -> |
| "/filter" -> |
1277 |
|
|
1278 |
| args -> |
| args -> |
1279 |
List.iter (fun (s,v) -> |
List.iter (fun (s,v) -> |
1280 |
lprintf "[%s]=[%s]\n" (String.escaped s) (String.escaped v)) |
lprintf_nl () "[%s]=[%s]" (String.escaped s) (String.escaped v)) |
1281 |
args; |
args; |
1282 |
raise Not_found |
raise Not_found |
1283 |
end |
end |
1340 |
|
|
1341 |
| args -> |
| args -> |
1342 |
List.iter (fun (s,v) -> |
List.iter (fun (s,v) -> |
1343 |
lprintf "[%s]=[%s]\n" (String.escaped s) (String.escaped v)) |
lprintf_nl () "[%s]=[%s]" (String.escaped s) (String.escaped v)) |
1344 |
args; |
args; |
1345 |
raise Not_found |
raise Not_found |
1346 |
end |
end |