Add new Process subsystem.
This patch adds a new Process subsystem for running external programs in the background of Tor. The design is focused around a new type named `process_t` which have an API that allows the developer to easily write code that interacts with the given child process. These interactions includes: - Easy API for writing output to the child process's standard input handle. - Receive callbacks whenever the child has output on either its standard output or standard error handles. - Receive callback when the child process terminates. We also support two different "protocols" for handling output from the child process. The default protocol is the "line" protocol where the process output callbacks will be invoked only when there is complete lines (either "\r\n" or "\n" terminated). We also support the "raw" protocol where the read callbacks will get whatever the operating system delivered to us in a single read operation. This patch does not include any operating system backends, but the Unix and Windows backends will be included in separate commits. See: https://bugs.torproject.org/28179
Showing
- src/app/main/main.c 6 additions, 0 deletionssrc/app/main/main.c
- src/lib/process/.may_include 3 additions, 2 deletionssrc/lib/process/.may_include
- src/lib/process/include.am 2 additions, 0 deletionssrc/lib/process/include.am
- src/lib/process/process.c 644 additions, 0 deletionssrc/lib/process/process.c
- src/lib/process/process.h 127 additions, 0 deletionssrc/lib/process/process.h
- src/test/include.am 1 addition, 0 deletionssrc/test/include.am
- src/test/test.c 1 addition, 0 deletionssrc/test/test.c
- src/test/test.h 1 addition, 0 deletionssrc/test/test.h
- src/test/test_process.c 558 additions, 0 deletionssrc/test/test_process.c
Loading
Please register or sign in to comment