libexec: unlazify launch-builder capnp message reading
StreamFdMessageReader reads message data *lazily*. if you don't access all segments of the message before you close the underlying stream you may find yourselv reading from something *very* different, and in this case that something is The Void™. this causes reads to fail, writes on the other side to fail to match, and finally our build launch to fail. this does not lead to happy outcomes, so we will copy the full message into a fresh new buffer *before* we try to access any of its contents. fixes #1118 all-analysis-by: deprekated <kate@lix.systems> Change-Id: I105540831fde855817194e9e539acf177f54a6f4
This commit is contained in:
@@ -116,9 +116,10 @@ int main(int argc, char * argv[])
|
||||
bool sendException = true;
|
||||
|
||||
try {
|
||||
capnp::StreamFdMessageReader reader(STDIN_FILENO);
|
||||
capnp::MallocMessageBuilder buf;
|
||||
capnp::readMessageCopyFromFd(STDIN_FILENO, buf);
|
||||
|
||||
auto request = reader.getRoot<build::Request>();
|
||||
auto request = buf.getRoot<build::Request>().asReader();
|
||||
|
||||
printDebugLogs = request.getDebug();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user