rp_serve_concrete_file (public)

 rp_serve_concrete_file file

Defined in packages/acs-tcl/tcl/request-processor-procs.tcl

Serves a file.

Parameters:
file (required)

Partial Call Graph (max 5 caller/called nodes):
%3 rp_handle_request rp_handle_request (private) rp_serve_concrete_file rp_serve_concrete_file rp_handle_request->rp_serve_concrete_file rp_serve_abstract_file rp_serve_abstract_file (private) rp_serve_abstract_file->rp_serve_concrete_file ad_file ad_file (public) rp_serve_concrete_file->ad_file ad_raise ad_raise (public) rp_serve_concrete_file->ad_raise ad_try ad_try (public) rp_serve_concrete_file->ad_try ds_add ds_add (public) rp_serve_concrete_file->ds_add ds_init ds_init (public) rp_serve_concrete_file->ds_init

Testcases:
No testcase defined.
Source code:
    set extension [ad_file extension $file]
    set startclicks [clock clicks -microseconds]

    if { [nsv_exists rp_extension_handlers $extension] } {
        set handler [nsv_get rp_extension_handlers $extension]

        #ns_log notice "check for extension handler for <$file> ==> <$handler>"

        ad_try -auto_abort=false {
            ds_init
            $handler
        } trap {AD EXCEPTION ad_script_abort} {r} {
            #
            # swallow script_aborts silently
            #
            #ns_log notice "rp_serve_concrete_file: swallow ad_script_abort"
        } on error {errMsg} {
            #
            # raise true exception
            #
            #ns_log notice "rp_serve_concrete_file: on error $errMsg"
            ds_add rp [list serve_file [list $file $handler]  $startclicks [clock clicks -microseconds]  error "$::errorCode: $::errorInfo"]
            return -code error -errorcode $::errorCode -errorinfo $::errorInfo $errMsg
        } on ok {r} {
            ds_add rp [list serve_file [list $file $handler]  $startclicks [clock clicks -microseconds]]
        } finally {
            rp_finish_serving_page
        }

    } elseif { [rp_file_can_be_public_p $file] } {
        set type [ns_guesstype $file]
        ds_add rp [list serve_file [list $file $type]  $startclicks [clock clicks -microseconds]]
        ns_returnfile 200 $type $file
    } else {
        ad_raise notfound
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: