display user-agent and x-work-identifier in logs
authorForrest Voight <forrest@forre.st>
Mon, 22 Aug 2011 03:46:34 +0000 (23:46 -0400)
committerForrest Voight <forrest@forre.st>
Mon, 22 Aug 2011 03:46:34 +0000 (23:46 -0400)
p2pool/worker_interface.py

index 673fa85..90e91d8 100644 (file)
@@ -121,13 +121,13 @@ class WorkerInterface(jsonrpc.Server):
     
     @defer.inlineCallbacks
     def getwork(self, request, long_poll=False):
-        id = random.randrange(10000)
-        if p2pool.DEBUG:
-            print 'POLL %i START long_poll=%r' % (id, long_poll)
-        
         request_id = get_id(request)
         memory = get_memory(request)
         
+        id = random.randrange(10000)
+        if p2pool.DEBUG:
+            print 'POLL %i START long_poll=%r user_agent=%r x-work-identifier=%r' % (id, long_poll, request.getHeader('User-Agent'), request.getHeader('X-Work-Identifier'))
+        
         if request_id not in self.last_cache_invalidation:
             self.last_cache_invalidation[request_id] = variable.Variable((None, None))