This procedure is defined in the server but not documented via ad_proc or proc_doc and may be intended as a private interface.
The procedure is defined as:
proc nsmcp::accessTimeIndexAdvance {channel fileVar stateVar budgetVar options limits publish sourceSize} {
upvar 1 $fileVar file $stateVar state $budgetVar budget
set offset [dict get $file offset]
if {[dict exists $file nativeTail] || [dict exists $file timeIndexRejected $offset]} {
return false
}
set entry [accessTimeIndexLoad $file]
if {$entry eq "" || ![dict exists $entry segments $offset]} {
return false
}
set segment [dict get $entry segments $offset]
set end [dict get $segment end]
if {$end>$sourceSize || ![accessTimeIndexOutside $segment $options]} {
return false
}
set bytes [expr {$end-$offset}]
if {[dict get $segment stamp] ne [accessTimeIndexStamp $file]
|| ![dict exists $segment trusted] || ![dict get $segment trusted] || ![accessScanRangeMature $file $limits]} {
if {$bytes>[dict get $limits bytes]-[dict get $state examinedBytes]} {
return false
}
if {$bytes>$budget} {
if {$bytes>[dict get $limits slice]+[dict get $limits line]} {
return false
}
if {$budget<[dict get $limits slice]} {
# Resume at this line boundary with a fresh worker slice rather
# than reading a fragment that destroys the seek checkpoint.
dict set file timeIndexYield true
return false
}
# One final physical line may extend a cached range slightly past
# a slice, just as the sequential reader can finish one long line.
}
accessScanProgress $publish validating-index $state $file $offset $sourceSize
seek $channel $offset
set data [read $channel $bytes]
dict incr state examinedBytes [string length $data]
dict incr file timeIndexValidationBytes [string length $data]
incr budget -[string length $data]
if {[string length $data]!=$bytes || [ns_crypto::md string -digest sha256 -- $data] ne [dict get $segment digest]} {
dict set file timeIndexRejected $offset true
return false
}
dict set segment stamp [accessTimeIndexStamp $file]
dict set segment trusted [accessScanRangeMature $file $limits]
dict set segment final [expr {$end==$sourceSize}]
accessTimeIndexSave $file $segment
}
accessTimeIndexEvidence file $segment
dict set file offset $end
dict set file timeIndexHit true
dict incr file timeIndexSkippedBytes $bytes
dict set file rangeUncertain true
# EOF is reached through verified exclusion, not physical examination.
seek $channel $end
accessScanProgress $publish seeking $state $file $end $sourceSize
return true
}