/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

Remove duplication of request version identification logic in wsgi.py

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
    
166
166
        return [response_data]
167
167
 
168
168
    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)
 
169
        protocol_factory, unused_bytes = medium._get_protocol_factory_for_bytes(
 
170
            request_bytes)
 
171
        server_protocol = protocol_factory(transport, write_func, rcp)
 
172
        server_protocol.accept_bytes(unused_bytes)
179
173
        return server_protocol