338 |
eval (ref true) command calendar_options; |
eval (ref true) command calendar_options; |
339 |
lprintf_nl () "Calendar execute: %s" command; |
lprintf_nl () "Calendar execute: %s" command; |
340 |
lprintf_nl () "%s" (Buffer.contents calendar_options.conn_buf); |
lprintf_nl () "%s" (Buffer.contents calendar_options.conn_buf); |
341 |
Buffer.clear calendar_options.conn_buf; |
Buffer.reset calendar_options.conn_buf; |
342 |
end |
end |
343 |
) !!calendar |
) !!calendar |
344 |
|
|
458 |
Buffer.add_char telnet.telnet_buffer c; |
Buffer.add_char telnet.telnet_buffer c; |
459 |
telnet.telnet_wait <- 1 |
telnet.telnet_wait <- 1 |
460 |
| _ -> |
| _ -> |
461 |
Buffer.clear telnet.telnet_buffer |
Buffer.reset telnet.telnet_buffer |
462 |
); |
); |
463 |
iter () |
iter () |
464 |
end else |
end else |
475 |
if len = 2 then |
if len = 2 then |
476 |
match cmd with |
match cmd with |
477 |
"\251\031" -> |
"\251\031" -> |
478 |
Buffer.clear telnet.telnet_buffer |
Buffer.reset telnet.telnet_buffer |
479 |
| "\250\031" -> |
| "\250\031" -> |
480 |
telnet.telnet_wait <- 4 |
telnet.telnet_wait <- 4 |
481 |
| _ -> |
| _ -> |
482 |
(* |
(* |
483 |
lprintf "telnet server: Unknown control sequence %s\n" |
lprintf "telnet server: Unknown control sequence %s\n" |
484 |
(String.escaped cmd); *) |
(String.escaped cmd); *) |
485 |
Buffer.clear telnet.telnet_buffer |
Buffer.reset telnet.telnet_buffer |
486 |
else |
else |
487 |
let s = String.sub cmd 0 2 in |
let s = String.sub cmd 0 2 in |
488 |
Buffer.clear telnet.telnet_buffer; |
Buffer.reset telnet.telnet_buffer; |
489 |
match s with |
match s with |
490 |
| "\250\031" -> |
| "\250\031" -> |
491 |
let dx = BigEndian.get_int16 cmd 2 in |
let dx = BigEndian.get_int16 cmd 2 in |
508 |
else begin |
else begin |
509 |
(* evaluate the command *) |
(* evaluate the command *) |
510 |
let cmd = Buffer.contents telnet.telnet_buffer in |
let cmd = Buffer.contents telnet.telnet_buffer in |
511 |
Buffer.clear telnet.telnet_buffer; |
Buffer.reset telnet.telnet_buffer; |
512 |
if cmd <> "" then begin |
if cmd <> "" then begin |
513 |
before_telnet_output o sock; |
before_telnet_output o sock; |
514 |
let buf = o.conn_buf in |
let buf = o.conn_buf in |
515 |
Buffer.clear buf; |
Buffer.reset buf; |
516 |
if o.conn_output = ANSI then Printf.bprintf buf "> $b%s$n\n" cmd; |
if o.conn_output = ANSI then Printf.bprintf buf "> $b%s$n\n" cmd; |
517 |
eval telnet.telnet_auth cmd o; |
eval telnet.telnet_auth cmd o; |
518 |
Buffer.add_char buf '\n'; |
Buffer.add_char buf '\n'; |
652 |
(* we must eval the string as a command *) |
(* we must eval the string as a command *) |
653 |
( |
( |
654 |
let buf = o.conn_buf in |
let buf = o.conn_buf in |
655 |
Buffer.clear buf; |
Buffer.reset buf; |
656 |
let auth = ref true in |
let auth = ref true in |
657 |
eval auth s o; |
eval auth s o; |
658 |
CommonChat.send_text !!CommonOptions.chat_console_id None |
CommonChat.send_text !!CommonOptions.chat_console_id None |
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 = |
845 |
Buffer.clear buf; |
Buffer.reset buf; |
846 |
http_add_html_header r; |
http_add_html_header r; |
847 |
|
|
848 |
if not !!html_mods then |
if not !!html_mods then |
880 |
Buffer.add_string buf "</html>\n" |
Buffer.add_string buf "</html>\n" |
881 |
|
|
882 |
let clear_page buf = |
let clear_page buf = |
883 |
Buffer.clear buf; |
Buffer.reset buf; |
884 |
http_file_type := UNK |
http_file_type := UNK |
885 |
|
|
886 |
let http_handler o t r = |
let http_handler o t r = |