[CalendarServer-changes] [3664] CalendarServer/trunk/twistedcaldav/httpfactory.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Feb 12 15:14:38 PST 2009


Revision: 3664
          http://trac.macosforge.org/projects/calendarserver/changeset/3664
Author:   wsanchez at apple.com
Date:     2009-02-12 15:14:37 -0800 (Thu, 12 Feb 2009)
Log Message:
-----------
Insert config.HTTPRetryAfter using %d instead of string addition.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/httpfactory.py

Modified: CalendarServer/trunk/twistedcaldav/httpfactory.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/httpfactory.py	2009-02-12 23:10:58 UTC (rev 3663)
+++ CalendarServer/trunk/twistedcaldav/httpfactory.py	2009-02-12 23:14:37 UTC (rev 3664)
@@ -31,14 +31,17 @@
     def connectionMade(self):
         if config.MoreAccessLogData:
             log.msg(overloaded=self)
-        self.transport.write("HTTP/1.0 503 Service Unavailable\r\n"
-                             "Content-Type: text/html\r\n"
-                             "Retry-After: " + config.HTTPRetryAfter + "\r\n"
-                             "Connection: close\r\n\r\n"
-                             "<html><head><title>503 Service Unavailable</title></head>"
-                             "<body><h1>Service Unavailable</h1>"
-                             "The server is currently overloaded, "
-                             "please try again later.</body></html>")
+        self.transport.write(
+            "HTTP/1.0 503 Service Unavailable\r\n"
+            "Content-Type: text/html\r\n"
+            "Retry-After: %(retry)d\r\n"
+            "Connection: close\r\n\r\n"
+            "<html><head><title>503 Service Unavailable</title></head>"
+            "<body><h1>Service Unavailable</h1>"
+            "The server is currently overloaded, "
+            "please try again later.</body></html>"
+            % { "retry": config.HTTPRetryAfter }
+        )
         self.transport.loseConnection()
 
 class HTTP503LoggingFactory(HTTPFactory):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090212/73fa9634/attachment.html>


More information about the calendarserver-changes mailing list