~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_server.py

  • Committer: Martin Packman
  • Author(s): John Arbash Meinel
  • Date: 2011-09-30 16:29:17 UTC
  • mto: (6015.33.7 2.4)
  • mto: This revision was merged to the branch mainline in revision 6192.
  • Revision ID: martin.packman@canonical.com-20110930162917-zilsfmiuxzsky4so
Return early to avoid malloc(0) in create_delta_index_from_delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
287
287
 
288
288
    def serve(self):
289
289
        self.serving = True
 
290
        self.stopped.clear()
290
291
        # We are listening and ready to accept connections
291
292
        self.started.set()
292
293
        try:
452
453
        if debug_threads():
453
454
            sys.stderr.write('Client thread %s started\n' % (t.name,))
454
455
        # If an exception occured during the thread start, it will get raised.
455
 
        # In rare cases, an exception raised during the request processing may
456
 
        # also get caught here (see http://pad.lv/869366)
457
456
        t.pending_exception()
458
457
 
459
458
    # The following methods are called by the main thread
509
508
            sync_event=self.server.started,
510
509
            target=self.run_server)
511
510
        self._server_thread.start()
512
 
        # Wait for the server thread to start (i.e. release the lock)
 
511
        # Wait for the server thread to start (i.e release the lock)
513
512
        self.server.started.wait()
514
513
        # Get the real address, especially the port
515
514
        self.host, self.port = self.server.server_address