| 819 |
add_reply_header r "Accept-Ranges" "bytes" |
add_reply_header r "Accept-Ranges" "bytes" |
| 820 |
|
|
| 821 |
let http_send_bin r buf filename = |
let http_send_bin r buf filename = |
| 822 |
let file_to_send = File.to_string filename in |
let file_to_send = |
| 823 |
let clen = String.length file_to_send in |
try |
| 824 |
let ext_pos = (String.rindex filename '.') + 1 in |
File.to_string filename |
| 825 |
let exten = (String.sub filename ext_pos ((String.length filename) - ext_pos)) in |
with _ -> |
| 826 |
if !verbose_msg_servers then |
try |
| 827 |
lprintf_nl "Extension found [%s] for file: [%s]" exten filename; |
Hashtbl.find CommonPictures.files filename |
| 828 |
let ext = extension_to_file_ext exten in |
with Not_found -> |
| 829 |
http_add_bin_header r ext clen; |
try |
| 830 |
|
if String.sub filename 0 4 = "flag" then |
| 831 |
|
Hashtbl.find CommonPictures.files "flag_--.png" |
| 832 |
|
else |
| 833 |
|
raise Not_found |
| 834 |
|
with _ -> raise Not_found |
| 835 |
|
in |
| 836 |
|
let ext = extension_to_file_ext (Filename2.last_extension2 filename) in |
| 837 |
|
http_add_bin_header r ext (String.length file_to_send); |
| 838 |
Buffer.add_string buf file_to_send |
Buffer.add_string buf file_to_send |
| 839 |
|
|
| 840 |
let http_error_no_gd img_type = |
let http_error_no_gd img_type = |
| 1197 |
http_send_bin r buf "tag.jpg" |
http_send_bin r buf "tag.jpg" |
| 1198 |
| true -> raise Not_found) |
| true -> raise Not_found) |
| 1199 |
|
|
|
| "favicon.ico" -> |
|
|
if !verbose_msg_servers then |
|
|
lprintf_nl "favicon.ico request received by tracker"; |
|
|
http_send_bin r buf "favicon.ico" |
|
|
|
|
| 1200 |
| "filter" -> |
| "filter" -> |
| 1201 |
html_open_page buf t r true; |
html_open_page buf t r true; |
| 1202 |
let b = Buffer.create 10000 in |
let b = Buffer.create 10000 in |
| 1496 |
read_theme_page this_page else |
read_theme_page this_page else |
| 1497 |
if !!html_mods then !!CommonMessages.download_html_js_mods0 |
if !!html_mods then !!CommonMessages.download_html_js_mods0 |
| 1498 |
else !!CommonMessages.download_html_js_old) |
else !!CommonMessages.download_html_js_old) |
| 1499 |
| _ -> raise Not_found |
| s -> http_send_bin r buf (String.lowercase s) |
| 1500 |
with |
with |
| 1501 |
| Not_found -> |
| Not_found -> |
| 1502 |
let _, error_text_long, header = Http_server.error_page "404" "" "" |
let _, error_text_long, header = Http_server.error_page "404" "" "" |