~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2008-05-28 21:53:46 UTC
  • mfrom: (3453 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3458.
  • Revision ID: john@arbash-meinel.com-20080528215346-l8plys9h9ps624pn
merge bzr.dev

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
    
167
167
        return [response_data]
168
168
 
169
169
    def make_request(self, transport, write_func, request_bytes, rcp):
170
 
        # XXX: This duplicates the logic in
171
 
        # SmartServerStreamMedium._build_protocol.
172
 
        if request_bytes.startswith(protocol.REQUEST_VERSION_TWO):
173
 
            protocol_class = protocol.SmartServerRequestProtocolTwo
174
 
            request_bytes = request_bytes[len(protocol.REQUEST_VERSION_TWO):]
175
 
        else:
176
 
            protocol_class = protocol.SmartServerRequestProtocolOne
177
 
        server_protocol = protocol_class(
178
 
            transport, write_func, rcp)
179
 
        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)
180
174
        return server_protocol