/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/wsgi.py

  • Committer: Martin Pool
  • Date: 2008-05-27 03:00:53 UTC
  • mfrom: (3452 +trunk)
  • mto: (3724.1.1 lock-hooks)
  • mto: This revision was merged to the branch mainline in revision 3730.
  • Revision ID: mbp@sourcefrog.net-20080527030053-0mct6dypek0ysjc3
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
from cStringIO import StringIO
24
24
 
25
 
from bzrlib.smart import protocol
 
25
from bzrlib.smart import protocol, medium
26
26
from bzrlib.transport import chroot, get_transport
27
27
from bzrlib.urlutils import local_path_to_url
28
28
    
144
144
 
145
145
        if adjusted_relpath.startswith('/'):
146
146
            adjusted_relpath = adjusted_relpath[1:]
147
 
        assert not adjusted_relpath.startswith('/')
 
147
        if adjusted_relpath.startswith('/'):
 
148
            raise AssertionError(adjusted_relpath)
148
149
 
149
150
        transport = self.backing_transport.clone(adjusted_relpath)
150
151
        out_buffer = StringIO()
166
167
        return [response_data]
167
168
 
168
169
    def make_request(self, transport, write_func, request_bytes, rcp):
169
 
        # XXX: This duplicates the logic in
170
 
        # SmartServerStreamMedium._build_protocol.
171
 
        if request_bytes.startswith(protocol.REQUEST_VERSION_TWO):
172
 
            protocol_class = protocol.SmartServerRequestProtocolTwo
173
 
            request_bytes = request_bytes[len(protocol.REQUEST_VERSION_TWO):]
174
 
        else:
175
 
            protocol_class = protocol.SmartServerRequestProtocolOne
176
 
        server_protocol = protocol_class(
177
 
            transport, write_func, rcp)
178
 
        server_protocol.accept_bytes(request_bytes)
 
170
        protocol_factory, unused_bytes = medium._get_protocol_factory_for_bytes(
 
171
            request_bytes)
 
172
        server_protocol = protocol_factory(transport, write_func, rcp)
 
173
        server_protocol.accept_bytes(unused_bytes)
179
174
        return server_protocol