~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http.py

  • Committer: John Arbash Meinel
  • Date: 2005-09-17 21:57:11 UTC
  • mto: (1393.2.1)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: john@arbash-meinel.com-20050917215711-9fa31e650a1f2fd8
Got HttpTransport tests to pass. Check for EAGAIN, pass permit_failure around, etc

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
 
102
102
        TODO: HttpTransport.has() should use a HEAD request,
103
103
        not a full GET request.
 
104
 
 
105
        TODO: This should be changed so that we don't use
 
106
        urllib2 and get an exception, the code path would be
 
107
        cleaner if we just do an http HEAD request, and parse
 
108
        the return code.
104
109
        """
105
110
        try:
106
111
            f = get_url(self.abspath(relpath))
 
112
            # Without the read and then close()
 
113
            # we tend to have busy sockets.
 
114
            f.read()
 
115
            f.close()
107
116
            return True
108
117
        except BzrError:
109
118
            return False