~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/message.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-17 07:05:37 UTC
  • mfrom: (4152.1.2 branch.stacked.streams)
  • Revision ID: pqm@pqm.ubuntu.com-20090317070537-zaud24vjs2szna87
(robertc) Add client-side streaming from stacked branches (over
        bzr:// protocols) when the sort order is compatible with doing
        that. (Robert Collins, Andrew Bennetts)

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
import collections
18
18
from cStringIO import StringIO
134
134
 
135
135
    def _args_received(self, args):
136
136
        self.expecting = 'body'
137
 
        self.request_handler.args_received(args)
 
137
        self.request_handler.dispatch_command(args[0], args[1:])
138
138
        if self.request_handler.finished_reading:
139
139
            self._response_sent = True
140
140
            self.responder.send_response(self.request_handler.response)
283
283
                    self._protocol_decoder._get_in_buffer()[:10],
284
284
                    self._protocol_decoder.state_accept.__name__)
285
285
            raise errors.ConnectionReset(
286
 
                "Unexpected end of message. "
287
 
                "Please check connectivity and permissions, and report a bug "
288
 
                "if problems persist.")
 
286
                "please check connectivity and permissions")
289
287
        self._protocol_decoder.accept_bytes(bytes)
290
288
 
291
289
    def protocol_error(self, exception):
330
328
        while not self.finished_reading:
331
329
            while self._bytes_parts:
332
330
                bytes_part = self._bytes_parts.popleft()
333
 
                if 'hpssdetail' in debug.debug_flags:
 
331
                if 'hpss' in debug.debug_flags:
334
332
                    mutter('              %d byte part read', len(bytes_part))
335
333
                yield bytes_part
336
334
            self._read_more()
353
351
        raise errors.LockContention('(remote lock)')
354
352
    elif error_name == 'LockFailed':
355
353
        raise errors.LockFailed(*error_args[:2])
356
 
    elif error_name == 'FileExists':
357
 
        raise errors.FileExists(error_args[0])
358
 
    elif error_name == 'NoSuchFile':
359
 
        raise errors.NoSuchFile(error_args[0])
360
354
    else:
361
355
        raise errors.ErrorFromSmartServer(error_tuple)