def _addedDataToIncoming(self, inc, skipFinish=False):
        if not inc.receivedAllData():
            # Continue running and monitoring this socket
            return inc
        rdata, extra = '', ''
        try:
            rdata, extra = inc.data
            if isControlMessage(rdata):
                raise ValueError('Error: received control message "%s"; expecting incoming data.'%(str(rdata)))
            rEnv = ReceiveEnvelope(*rdata)
        except Exception:
            import traceback
            thesplog('OUCH!  Error deserializing received data: %s  (rdata="%s", extra="%s")',
                     traceback.format_exc(), rdata, extra)
            try:
                inc.socket.sendall(ackDataErrMsg)
            except Exception:
                pass  # socket will be closed anyhow; AckErr was a courtesy
            inc.close()
            return None
        inc.socket.sendall(ackMsg)
        inc.fromAddress = rdata[0]
        self._processReceivedEnvelope(rEnv)
        if extra and isinstance(inc, TCPIncomingPersistent):
            newinc = TCPIncomingPersistent(inc.fromAddress, inc.socket)
            newinc.addData(rdata)
            return self._addedDataToIncoming(newinc)
        if not skipFinish: self._finishIncoming(inc, rEnv.sender)
        return None
dataset/ETHPy150Open godaddy/Thespian/thespian/system/transport/TCPTransport.py/TCPTransport._addedDataToIncoming/original