At 03:16 PM 9/4/01 -0400, Jeff Johnson wrote:
>Someone hitting my site must have a bad cookie and when the Cookie
>parser fails, the thread just hangs.  Once all threads are hung the site
>stops responding.  I don't know the code well enought to know where to
>put the try/except but I think there should be a general try/except
>around handleRequest().  Any ideas or comments?
>
>
>Traceback (most recent call last):
>   File "/usr/local/lib/python2.1/threading.py", line 378, in __bootstrap
>     self.run()
>   File "/usr/local/lib/python2.1/threading.py", line 366, in run
>     apply(self.__target, self.__args, self.__kwargs)
>   File "/usr/Webware/Webware/WebKit/ThreadedAppServer.py", line 247, in
>threadloop
>     rh.handleRequest()
>   File "/usr/Webware/Webware/WebKit/ThreadedAppServer.py", line 479, in
>handleRequest
>     transaction = self.server._app.dispatchRawRequest(dict, strmOut)
>   File "WebKit/Application.py", line 310, in dispatchRawRequest
>   File "WebKit/Application.py", line 755, in createRequestForDict
>   File "WebKit/HTTPRequest.py", line 44, in __init__
>   File "WebUtils/Cookie.py", line 605, in load
>     for K,V in self.items():
>   File "WebUtils/Cookie.py", line 625, in __ParseString
>     n = len(str)     # Length of string
>IndexError: string index out of range

Please read this message from a couple of weeks ago -- it may suggest the 
answer to your problem -- a fix to Cookie.py:

http://www.geocrawler.com/archives/3/3854/2001/8/0/6436525/

Note that Cookie.py is a standard Python module as of Python 2.0, and I 
believe that Webware attempts to use the standard module if it's 
available.  You may have to patch the Cookie.py inside your Python 
installation.

I'm a bit confused though -- there appears to be a copy of the standard 
Cookie module in WebKit/zCookieEngine.py and also in 
WebUtils/Cookie.py.  They are identical.  We should get rid of one of 
them.  Then, since Python's Cookie.py has bugs, we should just _always_ use 
the Cookie.py in Webware instead of trying to use Python's Cookie.py, at 
least until a version of Python comes out with a fixed version of Cookie.py.

If this sounds like the right plan, I'll go ahead and make the changes.


--

- Geoff Talvola
   [EMAIL PROTECTED]

_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to