Fred,

Yup -- there are a few places in the code where there's a Tcl API
without a corresponding C API.  And, the docs are out of date,
especially in the C API.  Happily the code is generally readable
although that's a crappy answer to the poor docs.

Anyway, in this case we'd need a few things:

- An Ns_File (or some other name) object which mapped to the
underlying File struct
- API's to get Ns_File's from an Ns_Conn.
- API's to get offset, lengths, and copy the content from the Ns_File

All that stuff is now just internal and accessed via the ns_conn
command. I figured someone may want such API's eventually but you're
the first to ask -- in general folks spend most of their time with
the Tcl API's although the C API's are pretty good in general.  In
practice, the code wouldn't be so hard -- the docs would probably be
more work.

I'd suggest you try out the Tcl API -- it could be used to handle all
the simple stuff and you can add commands to do any weird stuff in
C.  For completeness, I'll go ahead and add the missing C API's but
they'll show up only in the head version of the code, 4.5 or beyond,
and may be a few weeks or so as other changes are backed up.

BTW: The aolserver I/O model is designed to read-ahead all that data
before dispatching to the threads for processing -- if you're working
in a low-memory environment that may not be great for you.  There's
some other (undocumented) features to spool "large" files to an open
temp file but then the various API's (in Tcl and C) don't exist to
work with such files, only the Ns_ConnContentFd function exists to
get at the open fd.  Factoring out all that so in-memory and in-temp-
file would do the right thing would be quite a bit more work to get
right.

-Jim




On Jul 1, 2005, at 2:08 PM, Andrew Piskorski wrote:

On Thu, Jun 30, 2005 at 05:31:38PM -0700, Fred Cox wrote:


However, the documentation appears to be non-existent
or wildly out of date, which raises the bar
considerably.


Somewhat out of date, incomplete, and disorganized, yes.  Wildly so,
or non-existant, no.  My guess is you're looking in the wrong place.
Try these:

  http://panoptic.com/wiki/aolserver/227
  http://www.aolserver.com/docs/
  http://aolserver.am.net/cvs/tcl


I would prefer to use C, since I don't currently know
Tcl, and I am developing for a fairly low end machine.


IMNSHO that is an incredibly bad reason to use C, especially with
AOLserver, and especially if you plan to write code using AOLserver on
an ongoing basis.

One of Tcl's advantages is that it is very easy for a good programmer
to pick up quickly.  A few days for basic competence, a harder to pin
down amount of time for true mastery.  It's harder to pin down, as it
depends more on what sort of problems you've tackled - e.g., how much
you've played with eval - than simply on how long you've used Tcl.


If I'm going to use an interpreted language, I may
end up using Apache 2.0 with MPM=worker and mod_perl,


Someone started work on a Perl binding for AOLserver on SourceForge,
but AFAIK it was alpha and no one has touched it for years now.  The
Standard ML and Python bindings were much further along, and Scheme
and Ruby probably were as well.  But AFAIK no one is currently using
any of those.  The PHP (definitely) and Java (I think) bindings work
and do get some use.  Oh, and Vlad Seryakov might actually be using
OCaml with AOLserver, not sure.

  http://www.panoptic.com/wiki/aolserver/165


I have figured out how to use Ns_RegisterRequest, and
Ns_ConnGetQuery, but it appears that clean access to
uploaded files is limited to Tcl.  In C, the Ns_Set


You could always simply call the Tcl APIs from C.  Not the most
efficient way of doing things, but then it shouldn't be any SLOWER
than just using the Tcl APIs from Tcl in the first place, so it should
be fine.

--
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to
<[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the
Subject: field of your email blank.



--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to