[Twisted-Python] better way to do this?

Eli Criffield elicriffield at gmail.com
Tue May 29 22:33:24 MDT 2007


Yeah that works. I was racking my brain trying to figure out the easy
way to do it....

Thanks

Eli Criffield

On 5/29/07, Glenn Hochberg <gah at research.att.com> wrote:
>
> On May 29, 2007, at 6:24 PM, Eli Criffield wrote:
>
>
> What i want to do is validate the "From" host of an xmlrpc server
>
> against a list of allowed servers.
>
>
>
>
> Sounds easy enough but "connectionMade(self)" Call is way back in
>
> http.HTTPChannel. That is set as the protocol in http.HTTPFactory and
>
> HTTPFactory is inherits by server.Site.
>
>
>
>
> So whats the best way to change one little function in http.HTTPChannel ?
>
>
>
>
> Here is what i have now, but the I have to include all of server.Site
>
> in my example, even though its unchanged except it inherits
>
> myHTTPFactory instead of http.HTTPFactory.
>
>
>
>
> Is there a simpler way to do this?
>
>
>
>
> Eli Criffield
> <snip>
>
> This seems like it should work; I tried it with your Example and it does
> seem to have the same effect:
>
> class mySite(server.Site):
>
>    protocol = myHTTPChannel
>
>
> Glenn Hochberg
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>




More information about the Twisted-Python mailing list