To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit f3aa4e20 authored by Roman Trüb's avatar Roman Trüb

added sanitizing of forwarded serial for direction "write"

parent 60119ff3
......@@ -796,9 +796,14 @@ def ThreadSocketProxy(msgQueueSockBuf, ServerSock, sf, msgQueueDbBuf, mode, stop
# syslog(LOG_INFO, "<--- Wrote data to SF: >%s<"%(str(data)))
# Signal with 1, that data is from writer (use 0 for reader):
try:
msgQueueDbBuf.put([1, data, timestamp], False)
dataSanList = data.replace(b'\r', b'').split('\n')
for i, dataSan in enumerate(dataSanList):
ts = timestamp + i * 0.000001 # with sligthly different timestamps we make sure that ordering is preserved
msgQueueDbBuf.put([1, dataSan, ts], False)
except Queue.full:
syslog(LOG_ERR, "Queue msgQueueDbBuf full in ThreadSocketProxy, dropping data.")
except Exception:
syslog(LOG_ERR, "Serial data could not be sanitized, dropping data.")
elif s is msgQueueSockBuf:
# Retrieve element from queue:
item = msgQueueSockBuf.get()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment