Index: openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl,v diff -u -r1.68.2.14 -r1.68.2.15 --- openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl 8 Dec 2020 15:51:38 -0000 1.68.2.14 +++ openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl 2 Aug 2021 21:16:31 -0000 1.68.2.15 @@ -446,16 +446,17 @@ set :spooling 1 # puts -nonewline [:channel] $data # :done - set filename [ad_tmpnam] - set fd [open $filename w] + + set fd [file tempfile spool_filename [ad_tmpdir]/nsd-spool-XXXXXX] fconfigure $fd -translation binary -encoding $encoding puts -nonewline $fd $data close $fd - set fd [open $filename] + + set fd [open $spool_filename] fconfigure $fd -translation binary -encoding $encoding fconfigure [:channel] -translation binary -encoding $encoding fcopy $fd [:channel] -command \ - [list [self] end-delivery $filename $fd [:channel] $request] + [list [self] end-delivery $spool_filename $fd [:channel] $request] } } ::HttpSpooler instproc end-delivery {filename fd ch request bytes args} {