~bzr-pqm/bzr/bzr.dev

Viewing all changes in revision 5247.3.36.

  • Committer: Vincent Ladeuil
  • Date: 2010-06-18 07:51:17 UTC
  • mto: (5247.4.16 sftp-leaks)
  • mto: This revision was merged to the branch mainline in revision 5396.
  • Revision ID: v.ladeuil+lp@free.fr-20100618075117-mtkr7hzyz34hht7i
Start refactoring the smart server to control which thread it runs in.

* bzrlib/tests/test_server.py:
(SmartTCPServer_for_testing.__init__): The server is run in a
background thread but creates the server socket in the main
thread.

* bzrlib/tests/test_smart_transport.py:
(TestSmartTCPServer.test_get_error_unexpected)
(SmartTCPTests.start_server): The server is run in a background
thread but creates the server socket in the main thread.

* bzrlib/smart/server.py:
(SmartTCPServer): Start separating the thread handling from the
sockets handling to make it it fit with TestingTCPServerInAThread.
(SmartTCPServer._create_server_socket): The server socket
creation.
(SmartTCPServer._backing_urls): What urls are served.
(SmartTCPServer.run_server_started_hooks)
(SmartTCPServer.run_server_stopped_hooks): The start/stop hooks.
(BzrServerFactory._make_smart_server): The server is run in the
main thread.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: