mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-09-21 05:26:20 +02:00
Remember to set reached_eof
when our handles are reporting errors.
This patch adds some missing calls to set `reached_eof` of our handles when various error conditions happens or when we close our handle (which happens at `process_terminate()`. See: https://bugs.torproject.org/28179
This commit is contained in:
parent
c6e041e3d8
commit
36e24782f8
@ -367,6 +367,7 @@ process_win32_write(struct process_t *process, buf_t *buffer)
|
||||
if (! ret) {
|
||||
log_warn(LD_PROCESS, "WriteFileEx() failed: %s",
|
||||
format_win32_error(GetLastError()));
|
||||
win32_process->stdin_handle.reached_eof = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -749,6 +750,7 @@ process_win32_cleanup_handle(process_win32_handle_t *handle)
|
||||
if (handle->pipe != INVALID_HANDLE_VALUE) {
|
||||
CloseHandle(handle->pipe);
|
||||
handle->pipe = INVALID_HANDLE_VALUE;
|
||||
handle->reached_eof = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -930,6 +932,7 @@ process_win32_read_from_handle(process_win32_handle_t *handle,
|
||||
if (! ret) {
|
||||
log_warn(LD_PROCESS, "ReadFileEx() failed: %s",
|
||||
format_win32_error(GetLastError()));
|
||||
handle->reached_eof = true;
|
||||
return bytes_available;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user