At 08:09 AM 9/26/2001 -0700, Tavis Rudd wrote:
>The problem is that ThreadedAppServer isn't catching the
>exception that is raised when bad marshal data is sent from
>the adaptor.  Each time it receives some it hangs the
>current thread.  All that's needed to prevent this is a
>simple try/except block. Here's how I did it in the
>redesign code:
>
>         try:
>             recv = conn.recv
>             data = []
>             chunk = ''
>             while len(chunk) < int_length:
>                 chunk += recv(int_length)
>             dict_length = loads(chunk)
>
>             if type(dict_length) != intType:
>                 raise ValueError
>
>             chunk = ''
>             missing = dict_length
>             while missing > 0:
>                 chunk += recv(missing)
>                 missing = dict_length - len(chunk)
>
>             reqDict = loads(chunk)
>
>         except ValueError:
>             conn.close()
>             print "Webware Error: Invalid protocol"
>             # @@TR: should we do some sort of logging?
>             return 0
>
>Line 443 in ThreadedAppServer.py is where this is needed.
>It would also be a good idea to add an even higher level
>try/except that catches any unhandled exception whatsoever
>so WebKit's AppServer is uncrashable.
>Tavis

Already done.  I put in the higher level exception handler a few weeks 
ago.  See line 248 in ThreadedAppServer.py from CVS:

                                                 try:
                                                         rh.handleRequest()
                                                 except:
                                                         
traceback.print_exc(file=sys.stderr)

So if you were using Webware from CVS, this wouldn't have crashed your app 
server (I think).

Of course, there's the separate issue of why lynx would cause the marshaled 
data to be wrong.  I don't have any explanation for that, and I'll have to 
let someone else try to figure that out since I'm a Windows user.


- Geoff


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

Reply via email to