1.1 --- a/WebStack/Twisted.py Sat Sep 01 00:26:10 2007 +0000
1.2 +++ b/WebStack/Twisted.py Sat Sep 01 00:26:42 2007 +0000
1.3 @@ -68,7 +68,17 @@
1.4
1.5 "Returns the server port as a string."
1.6
1.7 - return str(self.trans.getHost()[2])
1.8 + host = self.trans.getHost()
1.9 +
1.10 + # Use the attribute for Twisted 2.0 or greater.
1.11 +
1.12 + if hasattr(host, "port"):
1.13 + return str(host.port)
1.14 +
1.15 + # Use the element for earlier versions.
1.16 +
1.17 + else:
1.18 + return str(host[2])
1.19
1.20 # Request-related methods.
1.21
1.22 @@ -78,6 +88,7 @@
1.23 Returns the request stream for the transaction.
1.24 """
1.25
1.26 + #self.trans.content.seek(0)
1.27 return self.trans.content
1.28
1.29 def get_request_method(self):