[Twisted-web] Can i inherit the twisted.web.http.Request.requestReceived ??

小学园PHP xxy-php at qq.com
Thu Apr 18 03:36:07 EDT 2013


Can i inherit the twisted.web.http.Request.requestReceived ??


In the comment, said that "This method is not intended for users".
I has inherited the rawDataReceived and it like this:


def rawDataReceived(self, data):
        self.resetTimeout()
        if len(data) < self.length:
            self.requests[-1].content.send(data)
            self.length = self.length - len(data)
        else:
            self.requests[-1].content.send(data[:self.length])
            self._finishRequestBody(data[self.length:])



the "self.requests[-1].content.send(data)" will send the data in another http connection. In fact, i use the httplib here.
All goes well, but it doesn't work at the last step in allContentReceived. And it's req.requestReceived(command, path, version).


So can i inherit this method requestReceived. Or where is it go wrong? 


my code is here. You can download it.
http://pan.baidu.com/share/link?shareid=569597&uk=926264233
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20130418/2eba298a/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cumulus.py
Type: application/octet-stream
Size: 30166 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20130418/2eba298a/attachment-0001.obj 


More information about the Twisted-web mailing list