~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/ftp_server/pyftpdlib_based.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-06 17:37:41 UTC
  • mfrom: (4728.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20091006173741-37lpt4t94xmt9ckt
(vila) Fix gssapi ftp client mode handling

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
        line = self.fs.fs2ftp(path)
85
85
        if self.fs.isfile(self.fs.realpath(path)):
86
86
            why = "Not a directory: %s" % line
87
 
            self.log('FAIL SIZE "%s". %s.' % (line, why))
 
87
            self.log('FAIL NLST "%s". %s.' % (line, why))
88
88
            self.respond("550 %s."  %why)
89
89
        else:
90
90
            ftpserver.FTPHandler.ftp_NLST(self, path)
180
180
        self._port = self._ftp_server.socket.getsockname()[1]
181
181
        self._ftpd_starting = threading.Lock()
182
182
        self._ftpd_starting.acquire() # So it can be released by the server
183
 
        self._ftpd_thread = threading.Thread(
184
 
                target=self._run_server,)
 
183
        self._ftpd_thread = threading.Thread(target=self._run_server,)
185
184
        self._ftpd_thread.start()
186
185
        # Wait for the server thread to start (i.e release the lock)
187
186
        self._ftpd_starting.acquire()
202
201
        self._ftpd_running = True
203
202
        self._ftpd_starting.release()
204
203
        while self._ftpd_running:
205
 
            self._ftp_server.serve_forever(timeout=0.1, count=1)
 
204
            try:
 
205
                self._ftp_server.serve_forever(timeout=0.1, count=1)
 
206
            except select.error, e:
 
207
                if e.args[0] != errno.EBADF:
 
208
                    raise
206
209
        self._ftp_server.close_all(ignore_all=True)
207
210
 
208
211
    def add_user(self, user, password):