Has anyone else found this problem yet.

I'm running tclhttpd3.2 on windows NT.  tcl cgi scripts that worked
fine under tclhttp3.0.3 no longer work because of what appears to be
a problem in the tclllib0.7 counter library.  

Here's the error:

can't use empty string as operand of "+"
    while executing
"expr {$counter(total) + $delta}"
    (procedure "counter::count" line 3)
    invoked from within
"counter::count $what $delta"
    (procedure "Count" line 5)
    invoked from within
"Count cgihits"
    (procedure "CgiSpawn" line 26)
    invoked from within
"CgiSpawn $sock $path"
    (procedure "CgiHandle" line 4)
    invoked from within
"CgiHandle /dm6/index.cgi {} C:/dmc/tcl/tclhttpd3.2/bin/../htdocs/dm6/index.cgi 
sock184"


This is what I was able to come up with.  When tclhttpd3.2 is started the
array counter::T-cgihits(total) is set to {}.  When the "Count cgihits" proc
which calls tclhttpd3.2/lib/counter.tcl--Count proc, the counter::exists cgihits 
returned 1 since the array already existed from somewhere else.  This then caused
the counter:counter proc in the tcllib to produce the above error.

I modified the counter::exists proc in the counter.tcl standard lib to:

proc counter::exists {tag} {
    upvar #0 counter::T-$tag counter
    if {![info exists counter] ||
        ($counter(total) < 0) } {
      return 0
    } else {
      return 1
    }
}


This seems to have fixed things for me though I'm not sure if this
is the optimal solution.

Suggestions..

Derek

Derek McEachern
Texas Instruments
Systems Development DMOS4
Phone: 972-995-2813
Pager: 888-799-6407
Email: [EMAIL PROTECTED]

Reply via email to