At 08:13 PM 7/20/01, you wrote:
> > does anyone know of  an easy way to get raw post data into
> > a tcl variable (from a connection) without writing it into a file first.
> >
> > i don't seem to see a way to do without using a C extension.
> >
> > -mike hoegeman

   set filename [ns_tmpnam]
   set fp [open $filename w+]
   ns_conncptofp $fp
   seek $fp 0
   append page_content [read $fp]
   close $fp

is the method used by AOLserver itself to read POST data (ns_queryget,
implemented in tcl, loaded from form.tcl in ...modules/tcl/).  If there
were a more efficient (C-based) interface, I'd imagine they would use
it.  And the lack of one might be based on a thoughtful design choice...
Kris?  Jim D.?

I suppose POST data file I/O could be a bottleneck, but have you profiled
it?  The data written to the file lives in a dirty system buffer, so it's
unlikely it's jamming your disk.  But why speculate when you can profile?

Mike Duffy

Reply via email to