Version 7 of Tclhttpd Problems with Mozilla Keep-Alive

Updated 2007-10-24 07:15:15 by hoffi

MHo, 2007-10-23

Here are some observations I made while I restarted an old project: porting an old tclhttpd 3.4.x-site to the latest incarnations of that webserver, 3.5.1 or 3.5.2.

I use my own build of that webserver, see Tclhttpd Winservice for further information.


The problem

I noticed that if I did not specify the file extension with an URL (like .htm or .tml), sometimes excessive delays occur. The resulting page appears in the browser, if ever, only after a very long delay period. Though I discover part of the program flow and learned that such page requests are satisfied via an error which was further handled by url_rewind and so on, I couldn't find any error.

But there are two facts:

  • The behaviour is different to 3.4x-versions of the webserver.
  • The logic has been largely rewritten between 3.4x and 3.5x (the monolythic doc.tcl splits up to doc.tcl, fallback.tcl., etc.).

Today, I found out that under the absolutely same circumstances my whole tests run fine with Opera. (I also tested IE7 but it failed for other reasions, as usual....). So I inspect my SeaMonkey settings once more. Just for a last test I disabled the Keep-Alive Option in the Http-Connection-Settings Page (stated as experimental), and: that did the trick!!!


Conclusion

There must be some subtle fact that leads to odd timeout/delay problems if a page was generated through fallback/url_unwind, in conjunction with specific browser settings.

Unfortunately, my understanding of the code isn't good enough to track this problem further down. And, I fear, the whole tclhttpd isn't really maintained any more....


Another one

Also, I found that some URLs where constructed like //xyz/abc within fallback.try, which leads to wrong results later:

      :
      # set url $virtual/[string trimleft $suffix /~] ; ####### old
        set url [file join $virtual [string trimleft $suffix /~]]; ###### new
        if {[info exist data(query)] && [string length $data(query)]} {
            append url ? $data(query)
        }

        Redirect_Self $url      ;# offer what we have to the client
       :

After applying that change, that error disappears.


I also reported a bug at sourceforge [L1 ], but it was a bit mazy and should be corrected and/or closed now...