[CalendarServer-changes] [4629] CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/ httpfactory.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 21 16:42:52 PDT 2009


Revision: 4629
          http://trac.macosforge.org/projects/calendarserver/changeset/4629
Author:   wsanchez at apple.com
Date:     2009-10-21 16:42:51 -0700 (Wed, 21 Oct 2009)
Log Message:
-----------
Don't add retryAfter header if config.HTTPRetryAfter is false.

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/httpfactory.py

Modified: CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/httpfactory.py
===================================================================
--- CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/httpfactory.py	2009-10-21 22:18:41 UTC (rev 4628)
+++ CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/httpfactory.py	2009-10-21 23:42:51 UTC (rev 4629)
@@ -32,7 +32,11 @@
     def connectionMade(self):
         log.msg(overloaded=self)
 
-        retryAfter = randint(int(config.HTTPRetryAfter * 1/2), int(config.HTTPRetryAfter * 3/2))
+        if config.HTTPRetryAfter:
+            retryAfter = randint(int(config.HTTPRetryAfter * 1/2), int(config.HTTPRetryAfter * 3/2))
+            headers = { "retryAfter": retryAfter }
+        else:
+            headers = {}
 
         self.transport.write("HTTP/1.0 503 Service Unavailable\r\n"
                              "Content-Type: text/html\r\n"
@@ -42,7 +46,7 @@
                              "<body><h1>Service Unavailable</h1>"
                              "The server is currently overloaded, "
                              "please try again later.</body></html>"
-                             % { "retryAfter": retryAfter })
+                             % headers)
 
         self.transport.loseConnection()
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20091021/76846855/attachment.html>


More information about the calendarserver-changes mailing list