зеркало из https://github.com/mozilla/mig.git
7ca2887a98
When a message between a module and the agent is read by either, ReadInput is used which uses buffered IO to read a single line. A bug existed here where a new bufio Reader was being allocated each time. Under normal circumstances there would be no issue, since a single line is generally sent to the module from the agent and read. However, in a case where a large number of messages were being exchanged between the agent and the module (e.g., persistent modules) it was possible the bufio reader could have buffered more than one line. Since a new buffer was being allocated each time, this resulted in loss of partial message data, and usually ended up generating JSON unmarshaling errors since part of the JSON structure was missing. This was resolved by introducing a new ModuleReader and ModuleWriter type that is used to read/write between the agent and modules. ModuleReader allocates the buffered reader on creation once, so we only ever have the single buffered reader for the lifetime of the module execution. |
||
---|---|---|
.. | ||
doc.rst | ||
paramscreator.go | ||
pkg.go | ||
pkg_test.go |