On Friday 06 June 2003 17:11, Don Baccus wrote:
> On Friday 06 June 2003 08:03 am, Zoran Vasiljevic wrote:
> > Nevertheles, to be really fair, there is some more work to be done
> > under the hood to get this working. The problem is in 1/.
> > Simple "interp create" won't work since script passed to ns_eval
> > might contain ns_* commands which are not part of the virgin
> > Tcl interp.
>
> These get defined if you run the THREAD_INIT callbacks registered by
> various modules to define their ns_* API commands, no?  Or are there others
> I'm not aware of?  As I said, yesterday afternoon was the first time I
> looked at this code so I don't pretend to understand all of it fully.

Look for InitInterp() in nsd/tclinit.c. The problem is that, although most of
the commands are already loaded (call to NsTclAddCmds(interp, itPtr))
those created by running traces (as registered by loaded modules)
are run only in the context of the running virtual server.

My initial idea was to simply make the Nsd as static package by doing
Tcl_StaticPackage() at the end of InitInterp() and then do from Tcl:

set interp [interp create]
$interp eval {load "" Nsd}
$interp eval [ns_ictl get]

and so on... but this won't get the proper virtual server context
so it'll skip the traces. Phew. I must dig little bit more there.

Zoran


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/

Reply via email to