[Pypi-checkins] r870 - trunk/pypi/tools

martin.von.loewis python-checkins at python.org
Mon Sep 20 21:50:49 CEST 2010


Author: martin.von.loewis
Date: Mon Sep 20 21:50:49 2010
New Revision: 870

Modified:
   trunk/pypi/tools/mirrorlib.py
Log:
Use /daytime on master server.


Modified: trunk/pypi/tools/mirrorlib.py
==============================================================================
--- trunk/pypi/tools/mirrorlib.py	(original)
+++ trunk/pypi/tools/mirrorlib.py	Mon Sep 20 21:50:49 2010
@@ -53,9 +53,15 @@
         self.status = 0
 
     def write(self):
-        self.socket.send('GET /last-modified HTTP/1.0\r\n'
+        url = 'last-modified'
+        if self.name == 'a.pypi.python.org':
+            # the master server doesn't provide last-modified,
+            # as that would be pointless. Instead, /daytime can be
+            # used as an indication of currency and responsiveness.
+            url = 'daytime'
+        self.socket.send('GET /%s HTTP/1.0\r\n'
                          'Host: %s\r\n'
-                         '\r\n' % self.name)
+                         '\r\n' % (url, self.name))
         self.status = 1
     
     def read(self):


More information about the Pypi-checkins mailing list