D4-project / d4-core

D4 core software (server and sample sensor client)
https://www.d4-project.org/
GNU Affero General Public License v3.0
43 stars 9 forks source link

Error when sending several meta-headers on same connection. #42

Open gallypette opened 4 years ago

gallypette commented 4 years ago

I know clients should not behave like this, but you never know what you receive.

2020-05-26 16:40:45+0200 [D4_Server (TLSMemoryBIOProtocol),724626,::ffff:149.13.33.94] Unhandled Error
        Traceback (most recent call last):
          File "/home/d4/d4-core/server/D4ENV/lib/python3.6/site-packages/twisted/python/log.py", line 103, in callWithLogger
            return callWithContext({"system": lp}, func, *args, **kw)
          File "/home/d4/d4-core/server/D4ENV/lib/python3.6/site-packages/twisted/python/log.py", line 86, in callWithContext
            return context.call({ILogContext: newCtx}, func, *args, **kw)
          File "/home/d4/d4-core/server/D4ENV/lib/python3.6/site-packages/twisted/python/context.py", line 122, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "/home/d4/d4-core/server/D4ENV/lib/python3.6/site-packages/twisted/python/context.py", line 85, in callWithContext
            return func(*args,**kw)
        --- <exception caught here> ---
          File "/home/d4/d4-core/server/D4ENV/lib/python3.6/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
            why = selectable.doRead()
          File "/home/d4/d4-core/server/D4ENV/lib/python3.6/site-packages/twisted/internet/tcp.py", line 243, in doRead
            return self._dataReceived(data)
          File "/home/d4/d4-core/server/D4ENV/lib/python3.6/site-packages/twisted/internet/tcp.py", line 249, in _dataReceived
            rval = self.protocol.dataReceived(data)
          File "/home/d4/d4-core/server/D4ENV/lib/python3.6/site-packages/twisted/protocols/tls.py", line 330, in dataReceived
            self._flushReceiveBIO()
          File "/home/d4/d4-core/server/D4ENV/lib/python3.6/site-packages/twisted/protocols/tls.py", line 295, in _flushReceiveBIO
            ProtocolWrapper.dataReceived(self, bytes)
          File "/home/d4/d4-core/server/D4ENV/lib/python3.6/site-packages/twisted/protocols/policies.py", line 120, in dataReceived
            self.wrappedProtocol.dataReceived(data)
          File "./server.py", line 207, in dataReceived
            self.process_header(data, self.ip, self.source_port)
          File "./server.py", line 387, in process_header
            logger.warning('Unexpected type change, type={} new type={}, ip={} uuid={} session_uuid={}'.format(ip, data_header['uuid_header'
], data_header['type'], self.session_uuid))
        builtins.IndexError: tuple index out of range