On success, this'll always return Ok(1). This leads to the caller (eg. write_all, or someone else trying really hard to submit the whole message) retrying to send the same message with the first byte removed, the next time with another one removed, etc. This leads to the same message being submitted again and again (in more and more truncated way):
Aug 18 20:21:17 hydra 0:21:17 pakon-aggregator[30302]: Shutting down, app: aggregator/0.1.0
Aug 18 20:21:17 hydra :21:17 pakon-aggregator[30302]: Shutting down, app: aggregator/0.1.0
Aug 18 20:21:17 hydra 21:17 pakon-aggregator[30302]: Shutting down, app: aggregator/0.1.0
Aug 18 20:21:17 hydra 1:17 pakon-aggregator[30302]: Shutting down, app: aggregator/0.1.0
Aug 18 20:21:17 hydra :17 pakon-aggregator[30302]: Shutting down, app: aggregator/0.1.0
Aug 18 20:21:17 hydra 17 pakon-aggregator[30302]: Shutting down, app: aggregator/0.1.0
Aug 18 20:21:17 hydra 7 pakon-aggregator[30302]: Shutting down, app: aggregator/0.1.0
I'm not completely sure on how to solve this properly. A workaround would be to have this:
But that assumes the null byte did fit when the message fit. I guess the chance of that one not fitting is pretty low and in the worst case, two messages may get concatenated, but a less hacky solution would be nice.
As promised, I went to confirm the changes work and I discovered some unintended behaviour of the null byte fix.
On success, this'll always return
Ok(1)
. This leads to the caller (eg.write_all
, or someone else trying really hard to submit the whole message) retrying to send the same message with the first byte removed, the next time with another one removed, etc. This leads to the same message being submitted again and again (in more and more truncated way):I'm not completely sure on how to solve this properly. A workaround would be to have this:
But that assumes the null byte did fit when the message fit. I guess the chance of that one not fitting is pretty low and in the worst case, two messages may get concatenated, but a less hacky solution would be nice.