Three more questions:

* Which is preferrable -- Url_ReadPost or Httpd_ReadPostData?
* Where (ha! :) is all of this stuff documented? The book chapter is kind of
skimpy..
* The last version of the web server on dev.scriptics.com is 3.1. Can you give
an idea
   how the 3.2 "cleaner way" works?

Thanks for all of this good stuff! I understand better now about httpd.tcl
being a "main program" and not reloadable.

One more Q: do you have performance data to compare TclHttpd with AOLserver? I
know this is not a list to discuss AOLserver, but just a small issue -- is the
Tcl event loop active in AOLserver?

--JYL

Brent Welch wrote:

> >>>Jacob Levy said:
>  > Brent
>  >
>  > Platform: Win98, Tcl/Tk 8.3.2, TclHttpd 3.1.0.
>  >
>  > Several small nits/questions:
>  >
>  > The end of the httpd.tcl script is a vwait. When you source this into
>  > another script, the outter script doesn't continue past the point where
>  > httpd.tcl is sourced. Removing the vwait and putting it at the end of
>  > the outter script fixes this. Is it the intent that people should edit
>  > and modify httpd.tcl?
>
> Yes, although I've just now rev'ed to 3.2 and added a cleaner way to
> drop code into the server so you don't have to modify the main script.
> In practice, however, I wouldn't be shocked to hear that you modify
> the startup code in a truely custom, embedded situtation.  For our
> Ajuba server we have our own startup sequence that is peculiar to
> our application.
>
>  > httpd.tcl also cannot be sourced multiple times. It complains that cget
>  > is already exported into some namespace.
>
> It'll also try to start the server listening sockets and fail as well.
> This script is a "main program", not a subroutine.
>
>  > When a URL domain URL gets called as a POST action from some form, the
>  > query data is not set. For example:
>  > HTML:
>  >    <form method=post action=/mine/doit>
>  >     ...
>  >     </form>
>  >
>  > Tcl:
>  >
>  >    Url_PrefixInstall /mine [list myhandler /mine]
>  >     proc myhandler {prefix sock postfix} {
>  >         upvar #0 Httpd$sock data
>  >
>  >         if {[string compare $data(proto) "POST"] == 0} {
>  >             # Oops, the $data(query) field is empty in this case, must
>  >             # get at the data with Url_ReadPost?
>  >         }
>  >     }
>
> The Httpd_ReadPostData interface was recently added to do this -
> in earlier versions the server always read all the post data,
> but in some applications the domain handler wants more control.
> There are also async variants  - skim the lib/httpd.tcl code
> and see how it is used in the doc.tcl code as well.
>
> --      Brent Welch     <[EMAIL PROTECTED]>
>         http://www.ajubasolutions.com
>         Scriptics changes to Ajuba Solutions
>         scriptics.com => ajubasolutions.com

Reply via email to