• Publicity: Public Only All

bgdelivery-procs.tcl

Routines for background delivery of files

Location:
packages/xotcl-core/tcl/bgdelivery-procs.tcl
Created:
19 Nov 2005
Author:
Gustaf Neumann <neumann@wu-wien.ac.at>
CVS Identification:
$Id: bgdelivery-procs.tcl,v 1.68.2.18 2023/05/30 10:01:46 gustafn Exp $

Procedures in this file

Detailed information

ad_returnfile_background (public)

 ad_returnfile_background [ -client_data client_data ] status_code \
    mime_type filename

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

bgdelivery proc nr_running (public)

 bgdelivery[i] nr_running

Interface to the background delivery thread to query the number of currently running deliveries.

Returns:
number of currently running background deliveries

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

bgdelivery proc returnfile (public)

 bgdelivery[i] returnfile [ -client_data client_data ] [ -delete delete ] \
    [ -content_disposition content_disposition ] status_code mime_type \
    filename

Deliver the given file to the requester in the background. This proc uses the background delivery thread to send the file in an event-driven manner without blocking a request thread. This is especially important when large files are requested over slow connections. With NaviServer, this function is mostly obsolete, at least, when writer threads are configured. The writer threads have as well the advantage, that these can be used with https, while the bgdelivery thread works directly on the socket. One remaining purpose of this function is h264 streaming delivery (when the module is in use).

Switches:
-client_data
(optional)
-delete
(defaults to "false") (optional)
-content_disposition
(optional)
Parameters:
status_code
mime_type
filename

Partial Call Graph (max 5 caller/called nodes):
%3 ad_conn ad_conn (public) ad_file ad_file (public) security::secure_conn_p security::secure_conn_p (public) thread::transfer thread::transfer xo::backslash_escape xo::backslash_escape bgdelivery proc returnfile bgdelivery proc returnfile bgdelivery proc returnfile->ad_conn bgdelivery proc returnfile->ad_file bgdelivery proc returnfile->security::secure_conn_p bgdelivery proc returnfile->thread::transfer bgdelivery proc returnfile->xo::backslash_escape

Testcases:
No testcase defined.

bgdelivery proc running (public)

 bgdelivery[i] running

Interface to the background delivery thread to query the currently running deliveries.

Returns:
list of key value pairs of all currently running background processes

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.
[ show source ]