~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/protocol.py

  • Committer: John Arbash Meinel
  • Date: 2009-10-12 21:44:27 UTC
  • mto: This revision was merged to the branch mainline in revision 4737.
  • Revision ID: john@arbash-meinel.com-20091012214427-zddi1kmc2jlf7v31
Py_ssize_t and its associated function typedefs are not available w/ python 2.4

So we define them in python-compat.h
Even further, gcc issued a warning for:
static int
_workaround_pyrex_096()
So we changed it to:
_workaround_pyrex_096(void)

Also, some python api funcs were incorrectly defined as 'char *' when they meant
'const char *'. Work around that with a (char *) cast, to avoid compiler warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
145
145
                self.request = request.SmartServerRequestHandler(
146
146
                    self._backing_transport, commands=request.request_handlers,
147
147
                    root_client_path=self._root_client_path)
148
 
                self.request.dispatch_command(req_args[0], req_args[1:])
 
148
                self.request.args_received(req_args)
149
149
                if self.request.finished_reading:
150
150
                    # trivial request
151
151
                    self.unused_data = self.in_buffer
897
897
            # We do *not* set self.decoding_failed here.  The message handler
898
898
            # has raised an error, but the decoder is still able to parse bytes
899
899
            # and determine when this message ends.
900
 
            log_exception_quietly()
 
900
            if not isinstance(exception.exc_value, errors.UnknownSmartMethod):
 
901
                log_exception_quietly()
901
902
            self.message_handler.protocol_error(exception.exc_value)
902
903
            # The state machine is ready to continue decoding, but the
903
904
            # exception has interrupted the loop that runs the state machine.
1036
1037
            raise errors.SmartMessageHandlerError(sys.exc_info())
1037
1038
 
1038
1039
    def _state_accept_reading_unused(self):
1039
 
        self.unused_data = self._get_in_buffer()
 
1040
        self.unused_data += self._get_in_buffer()
1040
1041
        self._set_in_buffer(None)
1041
1042
 
1042
1043
    def next_read_size(self):
1208
1209
        except (KeyboardInterrupt, SystemExit):
1209
1210
            raise
1210
1211
        except Exception:
 
1212
            mutter('_iter_with_errors caught error')
 
1213
            log_exception_quietly()
1211
1214
            yield sys.exc_info(), None
1212
1215
            return
1213
1216