~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/server.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-06 06:48:25 UTC
  • mfrom: (4070.8.6 debug-config)
  • Revision ID: pqm@pqm.ubuntu.com-20090306064825-kbpwggw21dygeix6
(mbp) debug_flags configuration option

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Server for smart-server protocol."""
18
18
 
21
21
import sys
22
22
import threading
23
23
 
24
 
from bzrlib.hooks import HookPoint, Hooks
 
24
from bzrlib.hooks import Hooks
25
25
from bzrlib import (
26
26
    errors,
27
27
    trace,
152
152
 
153
153
    def serve_conn(self, conn, thread_name_suffix):
154
154
        # For WIN32, where the timeout value from the listening socket
155
 
        # propagates to the newly accepted socket.
 
155
        # propogates to the newly accepted socket.
156
156
        conn.setblocking(True)
157
157
        conn.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
158
158
        handler = medium.SmartServerSocketStreamMedium(
208
208
        notified.
209
209
        """
210
210
        Hooks.__init__(self)
211
 
        self.create_hook(HookPoint('server_started',
212
 
            "Called by the bzr server when it starts serving a directory. "
213
 
            "server_started is called with (backing urls, public url), "
214
 
            "where backing_url is a list of URLs giving the "
215
 
            "server-specific directory locations, and public_url is the "
216
 
            "public URL for the directory being served.", (0, 16), None))
217
 
        self.create_hook(HookPoint('server_stopped',
218
 
            "Called by the bzr server when it stops serving a directory. "
219
 
            "server_stopped is called with the same parameters as the "
220
 
            "server_started hook: (backing_urls, public_url).", (0, 16), None))
 
211
        # Introduced in 0.16:
 
212
        # invoked whenever the server starts serving a directory.
 
213
        # The api signature is (backing urls, public url).
 
214
        self['server_started'] = []
 
215
        # Introduced in 0.16:
 
216
        # invoked whenever the server stops serving a directory.
 
217
        # The api signature is (backing urls, public url).
 
218
        self['server_stopped'] = []
221
219
 
222
220
SmartTCPServer.hooks = SmartServerHooks()
223
221