~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/HTTPTestUtil.py

  • Committer: John Arbash Meinel
  • Date: 2005-09-22 19:16:57 UTC
  • mto: (1393.2.1)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: john@arbash-meinel.com-20050922191657-f94ee98ba0f9f83e
Made it so that we don't loop forever on EAGAIN.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        commands such as GET and POST.
41
41
 
42
42
        """
43
 
        while True:
 
43
        for i in xrange(1,11): # Don't try more than 10 times
44
44
            try:
45
45
                self.raw_requestline = self.rfile.readline()
46
46
            except socket.error, e:
47
47
                if e.args[0] == errno.EAGAIN:
48
 
                    self.log_message('EAGAIN while reading from raw_requestline')
 
48
                    self.log_message('EAGAIN (%d) while reading from raw_requestline' % i)
49
49
                    time.sleep(0.01)
50
50
                    continue
51
51
                raise