diff --git a/mercurial/wireprotoframing.py b/mercurial/wireprotoframing.py --- a/mercurial/wireprotoframing.py +++ b/mercurial/wireprotoframing.py @@ -668,6 +668,9 @@ return makeframe(requestid, self.streamid, streamflags, typeid, flags, payload) +class inputstream(stream): + """Represents a stream used for receiving data.""" + def setdecoder(self, name, extraobjs): """Set the decoder for this stream. @@ -675,6 +678,9 @@ decoded from the stream encoding settings frame payloads. """ +class outputstream(stream): + """Represents a stream used for sending data.""" + def ensureserverstream(stream): if stream.streamid % 2: raise error.ProgrammingError('server should only write to even ' @@ -799,7 +805,7 @@ _('received frame on unknown inactive stream without ' 'beginning of stream flag set')) - self._incomingstreams[frame.streamid] = stream(frame.streamid) + self._incomingstreams[frame.streamid] = inputstream(frame.streamid) if frame.streamflags & STREAM_FLAG_ENCODING_APPLIED: # TODO handle decoding frames @@ -1012,7 +1018,7 @@ streamid = self._nextoutgoingstreamid self._nextoutgoingstreamid += 2 - s = stream(streamid) + s = outputstream(streamid) self._outgoingstreams[streamid] = s return s @@ -1372,7 +1378,7 @@ self._nextrequestid = 1 # We only support a single outgoing stream for now. - self._outgoingstream = stream(1) + self._outgoingstream = outputstream(1) self._pendingrequests = collections.deque() self._activerequests = {} self._incomingstreams = {} @@ -1485,7 +1491,8 @@ 'without beginning of stream flag set'), } - self._incomingstreams[frame.streamid] = stream(frame.streamid) + self._incomingstreams[frame.streamid] = inputstream( + frame.streamid) if frame.streamflags & STREAM_FLAG_ENCODING_APPLIED: raise error.ProgrammingError('support for decoding stream '