[Twisted-web] Setting server.Site.protocol stops the site factory resource class from renderin

David Reid dreid at dreid.org
Thu Mar 1 09:10:51 CST 2007

Hash: SHA1

On Feb 28, 2007, at 7:52 PM, Steve doh wrote:

> I have the code below that works fine. If I uncomment the 3rd to  
> last line so that the site.protocol uses the ServerProtocol class,  
> then the render_GET() method does not get called and the browser  
> waits for a response. I understand why this is happening but don't  
> know how to fix it. I need to override the connectionMade() method  
> for the site factory inorder to verify the connection. Can someone  
> explain how I override connectionMade() correctly? Any help  
> appreciated. Cheers Steve

twisted.internet.protocol.Protocol doesn't know anything about HTTP,  
and it doesn't know anything about the resource hierarchy and HTTP  
methods.  server.Site.protocol defaults to  
twisted.web.http.HTTPChannel, which does know what to do when faced  
with HTTP, so subclass that instead.  And don't forget to call the  
superclass's connectionMade or timeouts won't work properly.

- -David

"Usually the protocol is this: I appoint someone for a task,
which they are not qualified to do.  Then, they have to fight
a bear if they don't want to do it." -- Glyph Lefkowitz

Version: GnuPG v1.4.5 (Darwin)


More information about the Twisted-web mailing list