~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/medium.py

(jameinel) Fix the hanging tests, help prevent future hanging,
 and make the tests handle idle connections properly. (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
        try:
231
231
            while not self.finished:
232
232
                server_protocol = self._build_protocol()
233
 
                # TODO: This seems inelegant:
234
 
                if server_protocol is None:
235
 
                    # We could 'continue' only to notice that self.finished is
236
 
                    # True...
237
 
                    break
238
233
                self._serve_one_request(server_protocol)
239
234
        except errors.ConnectionTimeout, e:
240
235
            trace.note('%s' % (e,))
326
321
 
327
322
        :param protocol: a SmartServerRequestProtocol.
328
323
        """
 
324
        if protocol is None:
 
325
            return
329
326
        try:
330
327
            self._serve_one_request_unguarded(protocol)
331
328
        except KeyboardInterrupt: