ad_returnfile_background (public)

 ad_returnfile_background [ -client_data client_data ] status_code \
    mime_type filename

Defined in packages/xotcl-core/tcl/bgdelivery-procs.tcl

Deliver the given file to the requester in the background. When using NaviServer with its writer threads, ns_returnfile is perfectly fine since it delivers its contents already in the background. The main reason for using the bgdelivery thread is currently (2019) the support of h264 streaming (when the module is in use). So we check, whether h264 is available and requested, otherwise pass everything to ns_returnfile.

Switches:
-client_data
(optional)
Parameters:
status_code
mime_type
filename

Partial Call Graph (max 5 caller/called nodes):
%3 test_nested_self_references nested_self_references (test xowiki) ad_returnfile_background ad_returnfile_background test_nested_self_references->ad_returnfile_background security::csp::add_static_resource_header security::csp::add_static_resource_header (public) ad_returnfile_background->security::csp::add_static_resource_header xo::use_h264 xo::use_h264 (private) ad_returnfile_background->xo::use_h264 cr_write_content-file cr_write_content-file (private) cr_write_content-file->ad_returnfile_background richtext::ckeditor4::ckfinder::return_file richtext::ckeditor4::ckfinder::return_file (public) richtext::ckeditor4::ckfinder::return_file->ad_returnfile_background richtext::ckeditor5::ckfinder::return_file richtext::ckeditor5::ckfinder::return_file (public) richtext::ckeditor5::ckfinder::return_file->ad_returnfile_background

Testcases:
nested_self_references
Source code:
  #ns_log notice "ad_returnfile_background xo::use_h264 -> [xo::use_h264 $mime_type]"
  
  security::csp::add_static_resource_header -mime_type $mime_type  
  if {[xo::use_h264 $mime_type]} {
    bgdelivery returnfile -client_data $client_data $status_code $mime_type $filename
  } else {
    ns_returnfile $status_code $mime_type $filename
  }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: