Re: [naviserver-devel] Bug in upload stats

2006-07-13 Thread Vlad Seryakov
Hmm, this code loops through all drivers looking for the matching URL. But drivers can be mapped to different virtual servers, and some drivers can be shared among virtual servers, for name-based virtual hosting. Yes, that's right. It should be virtual-server aware if it's worth anything at a

Re: [naviserver-devel] Bug in upload stats

2006-07-13 Thread Stephen Deasey
On 7/13/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote: My bad :-(( Can you fix it, i cannot for some reason login into CVS over ssh No problem. I've left the tests for you -- I know that's your favourite part... :-) Hmm, this code loops through all drivers looking for the matching URL. But dr

Re: [naviserver-devel] Encoding

2006-07-13 Thread Stephen Deasey
On 7/13/06, Bernd Eidenschink <[EMAIL PROTECTED]> wrote: Hi Vlad, > Or you can try to replace ReturnCharData in return.c and see if this > works (i did not test it): yes, it seems to work: HTTP/1.1 200 OK MIME-Version: 1.0 Accept-Ranges: bytes Date: Thu, 13 Jul 2006 06:45:55 GMT Ser

Re: [naviserver-devel] Bug in upload stats

2006-07-13 Thread Vlad Seryakov
My bad :-(( Can you fix it, i cannot for some reason login into CVS over ssh Stephen Deasey wrote: In nsd/driver.c:NsTclUploadStatsObjCmd while (drvPtr != NULL) { Tcl_HashEntry *hPtr; spPtr = &drvPtr->spooler; Ns_MutexLock(&spPtr->lock); hPtr = Tcl_FindHashEn

[naviserver-devel] Bug in upload stats

2006-07-13 Thread Stephen Deasey
In nsd/driver.c:NsTclUploadStatsObjCmd while (drvPtr != NULL) { Tcl_HashEntry *hPtr; spPtr = &drvPtr->spooler; Ns_MutexLock(&spPtr->lock); hPtr = Tcl_FindHashEntry(&spPtr->table, Tcl_GetString(objv[1])); if (hPtr != NULL) { Sock *sockPtr = (Sock *)

[naviserver-devel] Timeout in DriverRecv?

2006-07-13 Thread Stephen Deasey
The nssock driver does this: case DriverRecv: timeout.sec = sock->driver->recvwait; n = Ns_SockRecvBufs(sock->sock, bufs, nbufs, &timeout); break; case DriverSend: timeout.sec = sock->driver->sendwait; n = Ns_SockSendBufs(sock->sock, bufs, nbufs, &timeout)

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/13/06, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote: Am 13.07.2006 um 23:18 schrieb Vlad Seryakov: > You are right and now i see that Naviserver does not do this right > because our global cache keeps strings only. It looks like waste of > resource now caching file contents only but ns_share

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 23:30 schrieb Stephen Deasey: On 7/13/06, Andrew Piskorski <[EMAIL PROTECTED]> wrote: On Thu, Jul 13, 2006 at 10:02:35PM +0100, Stephen Deasey wrote: Our caches are server-wide, not per-interp. Server-wide caches have their values stringified. Must they always though? Tha

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/13/06, Andrew Piskorski <[EMAIL PROTECTED]> wrote: On Thu, Jul 13, 2006 at 10:02:35PM +0100, Stephen Deasey wrote: > Our caches are server-wide, not per-interp. Server-wide caches have > their values stringified. Must they always though? That is also how the nsv_* commands worked, but I t

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 23:18 schrieb Vlad Seryakov: You are right and now i see that Naviserver does not do this right because our global cache keeps strings only. It looks like waste of resource now caching file contents only but ns_share uses Tcl_Objs internally, so it is possible to use it instead

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 23:15 schrieb Andrew Piskorski: Must they always though? That is also how the nsv_* commands worked, but I think Zoran's tsv_* commands do special work to retain the internal rep of many objects across tsv_set and tsv_get. Yes, but only for certain "known" types of Tcl objec

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Vlad Seryakov
You are right and now i see that Naviserver does not do this right because our global cache keeps strings only. It looks like waste of resource now caching file contents only but ns_share uses Tcl_Objs internally, so it is possible to use it instead maybe? Andrew Piskorski wrote: On Thu, Jul

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Andrew Piskorski
On Thu, Jul 13, 2006 at 10:02:35PM +0100, Stephen Deasey wrote: > Our caches are server-wide, not per-interp. Server-wide caches have > their values stringified. Must they always though? That is also how the nsv_* commands worked, but I think Zoran's tsv_* commands do special work to retain the

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Andrew Piskorski
On Thu, Jul 13, 2006 at 05:08:14PM -0400, Andrew Piskorski wrote: > Which maybe answers my question... I suspect that: Doh, never mind my silly speculations, Stephen just explained now it really works in his last post. -- Andrew Piskorski <[EMAIL PROTECTED]> http://www.piskorski.com/

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Andrew Piskorski
On Thu, Jul 13, 2006 at 04:53:51PM -0400, Andrew Piskorski wrote: > On Thu, Jul 13, 2006 at 09:28:00PM +0100, Stephen Deasey wrote: > > > Except... Rob found a neat way to cheat by passing the script as an > > arg to a do-nothing 'for' command. 'for' compiles the script for you. > > Very smart a

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 22:53 schrieb Andrew Piskorski: Right, output caching is a different thing. But wouldn't it be cool to have it working for ADP pages, Tcl pages, registered procs etc.? Yes, indeed it would... Do not forget that you get caching for free if you just move bulk of the code i

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/13/06, Andrew Piskorski <[EMAIL PROTECTED]> wrote: On Thu, Jul 13, 2006 at 09:28:00PM +0100, Stephen Deasey wrote: > Except... Rob found a neat way to cheat by passing the script as an > arg to a do-nothing 'for' command. 'for' compiles the script for you. > Very smart and hellish to read

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Andrew Piskorski
On Thu, Jul 13, 2006 at 09:28:00PM +0100, Stephen Deasey wrote: > Except... Rob found a neat way to cheat by passing the script as an > arg to a do-nothing 'for' command. 'for' compiles the script for you. > Very smart and hellish to read... Ok, some Tcl commands cause their script arguments to

Re: [naviserver-devel] Why was NaviServer forked?

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 19:39 schrieb Andrew Piskorski: A silly thing to lose half or so of AOLserver's active core developers over, and a silly thing to fork over as well... All IMO, of course. Do not unerestimate the AOLserver gatekeeper species! One (KH) spawned OpenNsd. The other Naviserver..

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/13/06, Andrew Piskorski <[EMAIL PROTECTED]> wrote: On Thu, Jul 13, 2006 at 08:44:17PM +0100, Stephen Deasey wrote: > Byte code can only be cached per-interp and our caches are > server-wide. Currently, it's just caching the read of the Tcl source > from disk. I thought the way Rob Mayoff'

Re: [naviserver-devel] running callbacks

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 22:16 schrieb Stephen Deasey: Maybe have a look if this particular cases is tested for... ok. will do.

Re: [naviserver-devel] ns_cache_forever

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 21:35 schrieb Stephen Deasey: I'm happy... I'm delighted, as long as it stays so :-) Cheers Zoran

Re: [naviserver-devel] running callbacks

2006-07-13 Thread Stephen Deasey
On 7/13/06, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote: Hi ! There is a call in tclcallbacks.c: Ns_TclCallbackArgProc(Tcl_DString *dsPtr, void *arg) { int ii; Ns_TclCallback *cbPtr = arg; Tcl_DStringAppendElement(dsPtr, cbPtr->script); for (ii = 0; ii < cbPtr->a

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Andrew Piskorski
On Thu, Jul 13, 2006 at 08:44:17PM +0100, Stephen Deasey wrote: > Byte code can only be cached per-interp and our caches are > server-wide. Currently, it's just caching the read of the Tcl source > from disk. I thought the way Rob Mayoff's original feature worked was that it "compiled" *.tcl pag

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/13/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote: This is from file.tcl, # And here's the magic part. We're using "for" here to translate the # text source file into bytecode, which will be associated with the # Tcl_Obj we just cached (as its internal representation). "eval"

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Vlad Seryakov
This is from file.tcl, # And here's the magic part. We're using "for" here to translate the # text source file into bytecode, which will be associated with the # Tcl_Obj we just cached (as its internal representation). "eval" # doesn't do this as the eval provided in Tcl uses the

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/13/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote: I meant .tcl file cacheing, which is in tcl/file.tcl when enabletclpages=on then all requests to .tcl are cached in global cache. Right, the Tcl is read from disk and cached in memory. But only the Tcl *source*. It needs to be byte code com

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Vlad Seryakov
I meant .tcl file cacheing, which is in tcl/file.tcl when enabletclpages=on then all requests to .tcl are cached in global cache. Stephen Deasey wrote: On 7/12/06, Andrew Piskorski <[EMAIL PROTECTED]> wrote: On Wed, Jul 12, 2006 at 04:03:37PM -0400, Vlad Seryakov wrote: Naviserver does it aut

Re: [naviserver-devel] Cache compiled Tcl page bytecode

2006-07-13 Thread Stephen Deasey
On 7/12/06, Andrew Piskorski <[EMAIL PROTECTED]> wrote: On Wed, Jul 12, 2006 at 04:03:37PM -0400, Vlad Seryakov wrote: > Naviserver does it automatically, it was ported a long time ago Awesome, that's good to know. It doesn't actually... Byte code can only be cached per-interp and our caches

Re: [naviserver-devel] ns_cache_forever

2006-07-13 Thread Stephen Deasey
On 7/11/06, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote: Am 11.07.2006 um 22:13 schrieb Stephen Deasey: > The API works for me... > OK. Perhaps I was not clear enough: We still have "ns_cache_create -ttl" syntax The new code does not support this (-ttl) option. I will now change our code to adj

Re: [naviserver-devel] Why was NaviServer forked?

2006-07-13 Thread Andrew Piskorski
On Wed, Jul 12, 2006 at 04:49:38PM +0200, Zoran Vasiljevic wrote: > > Am 12.07.2006 um 16:22 schrieb Andrew Piskorski: > > I would have started actively and frequently committing code to the > > AOLserver CVS, as Dossy explicitly asked/challenged you to do, rather > > than merely talking about do

Re: [naviserver-devel] running callbacks

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 16:44 schrieb Vlad Seryakov: Is it possible to retrieve callback operation from within callback without providing required first argument all the time. something line ns_callback operation, ns_callback script, ns_callback and in the callback and ns_callback command us

Re: [naviserver-devel] running callbacks

2006-07-13 Thread Vlad Seryakov
Is it possible to retrieve callback operation from within callback without providing required first argument all the time. something line ns_callback operation, ns_callback script, ns_callback and in the callback and ns_callback command use special tls which will be set with callback stru

Re: [naviserver-devel] running callbacks

2006-07-13 Thread Zoran Vasiljevic
Am 13.07.2006 um 10:17 schrieb Zoran Vasiljevic: Class Logger Logger log args { puts stderr $args } Logger proc log args { puts stderr $args } that is... Zoran

[naviserver-devel] running callbacks

2006-07-13 Thread Zoran Vasiljevic
Hi ! There is a call in tclcallbacks.c: Ns_TclCallbackArgProc(Tcl_DString *dsPtr, void *arg) { int ii; Ns_TclCallback *cbPtr = arg; Tcl_DStringAppendElement(dsPtr, cbPtr->script); for (ii = 0; ii < cbPtr->argc; ii++) { Tcl_DStringAppendElement(dsPtr, cbPtr->a

Re: [naviserver-devel] Encoding

2006-07-13 Thread Bernd Eidenschink
Hi Vlad, > Or you can try to replace ReturnCharData in return.c and see if this > works (i did not test it): yes, it seems to work: HTTP/1.1 200 OK MIME-Version: 1.0 Accept-Ranges: bytes Date: Thu, 13 Jul 2006 06:45:55 GMT Server: NaviServer/4.99.2 Content-Type: text/html; charset=i