Home | History | Annotate | Download | only in adb

Lines Matching refs:protocol

22 // protocol to wrap packets. The protocol allows separating stdout/stderr and
25 // Type Protocol | Exit code? Separate stdout/stderr?
33 // Non-protocol subprocesses work by passing subprocess stdin/out/err through
55 // The protocol requires the thread to intercept stdin/out/err in order to
56 // wrap/unwrap data with shell protocol packets.
62 // stdin/out <---> Protocol <---> LocalSocket
63 // stderr ---> Protocol ---> LocalSocket
66 // Exit ---> Exit code protocol ---> LocalSocket
72 // An alternate approach is to put the protocol wrapping/unwrapping in the main
153 SubprocessType type, SubprocessProtocol protocol);
195 // Shell protocol variables.
204 SubprocessType type, SubprocessProtocol protocol)
208 protocol_(protocol) {
209 // If we aren't using the shell protocol we must allocate a PTY to properly close the
213 // The shell protocol doesn't require a PTY because it's always monitoring the local socket FD
217 D("Can't create raw subprocess without shell protocol, using PTY in raw mode instead");
301 // Raw subprocess + shell protocol allows for splitting stderr.
362 // No protocol: all streams pass through the stdinout FD and hook
366 // Shell protocol: create another socketpair to intercept data.
373 D("protocol FD = %d", protocol_sfd_.fd());
378 *error = "failed to allocate shell protocol objects";
467 // Start by trying to read from the protocol FD, stdout, and stderr.
477 // Pass data until the protocol FD or both the subprocess pipes die, at
489 // needed (e.g. SIGINT), pass those through the shell protocol
491 D("protocol FD died, sending SIGHUP to pid %d", pid_);
535 // Read stdout, write to protocol FD.
540 // Read stderr, write to protocol FD.
545 // Read protocol FD, write to stdin.
558 // If we finished writing, go back to blocking on protocol read.
575 PLOG(ERROR) << "error reading protocol FD "
629 // dumping any further data received from the protocol FD.
653 PLOG(ERROR) << "error reading protocol FD " << protocol_sfd_.fd();
684 // If we have an open protocol FD send an exit packet.
715 static int ReportError(SubprocessProtocol protocol, const std::string& message) {
723 if (protocol == SubprocessProtocol::kShell) {
732 if (protocol == SubprocessProtocol::kShell) {
746 SubprocessType type, SubprocessProtocol protocol) {
747 D("starting %s subprocess (protocol=%s, TERM=%s): '%s'",
749 protocol == SubprocessProtocol::kNone ? "none" : "shell",
752 auto subprocess = std::make_unique<Subprocess>(name, terminal_type, type, protocol);
755 return ReportError(protocol, "failed to allocate new subprocess");
761 return ReportError(protocol, error);
769 return ReportError(protocol, error);