@@ -236,23 +236,8 @@ def getPage(**kwargs):
236236 the target URL page content
237237 """
238238
239- start = time .time ()
240-
241- if isinstance (conf .delay , (int , float )) and conf .delay > 0 :
242- time .sleep (conf .delay )
243-
244239 if conf .offline :
245240 return None , None , None
246- elif conf .dummy or conf .murphyRate and randomInt () % conf .murphyRate == 0 :
247- if conf .murphyRate :
248- time .sleep (randomInt () % (MAX_MURPHY_SLEEP_TIME + 1 ))
249-
250- return randomStr (int (randomInt ()), alphabet = [_unichr (_ ) for _ in xrange (256 )]), None , None if not conf .murphyRate else randomInt (3 )
251-
252- threadData = getCurrentThreadData ()
253- with kb .locks .request :
254- kb .requestCounter += 1
255- threadData .lastRequestUID = kb .requestCounter
256241
257242 url = kwargs .get ("url" , None ) or conf .url
258243 get = kwargs .get ("get" , None )
@@ -278,6 +263,27 @@ def getPage(**kwargs):
278263 finalCode = kwargs .get ("finalCode" , False )
279264 chunked = kwargs .get ("chunked" , False ) or conf .chunked
280265
266+ start = time .time ()
267+
268+ if isinstance (conf .delay , (int , float )) and conf .delay > 0 :
269+ time .sleep (conf .delay )
270+
271+ threadData = getCurrentThreadData ()
272+ with kb .locks .request :
273+ kb .requestCounter += 1
274+ threadData .lastRequestUID = kb .requestCounter
275+
276+ if conf .dummy or conf .murphyRate and randomInt () % conf .murphyRate == 0 :
277+ if conf .murphyRate :
278+ time .sleep (randomInt () % (MAX_MURPHY_SLEEP_TIME + 1 ))
279+
280+ page , headers , code = randomStr (int (randomInt ()), alphabet = [_unichr (_ ) for _ in xrange (256 )]), None , None if not conf .murphyRate else randomInt (3 )
281+
282+ threadData .lastPage = page
283+ threadData .lastCode = code
284+
285+ return page , headers , code
286+
281287 if multipart :
282288 post = multipart
283289
0 commit comments