diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-04-12 12:38:46 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-04-12 12:38:46 -0400 |
commit | d3b9b5a3dd6a6068557fc53176c41bc917100be2 (patch) | |
tree | ab34de9edbd727119b11ee2f6e89bce99c2c3cd6 /src/common/util.c | |
parent | f0887e30dd10e7fc0f73f8f1b792913a2d51c7b1 (diff) | |
download | tor-d3b9b5a3dd6a6068557fc53176c41bc917100be2.tar.gz tor-d3b9b5a3dd6a6068557fc53176c41bc917100be2.zip |
Remove windows log_from_handle as unused.
This function was only used by PortForwardingHelper, which was
removed in 9df110cd72. Its presence caused warnings on windows.
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/common/util.c b/src/common/util.c index 065b3245fe..041e7aee3d 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -5156,51 +5156,6 @@ tor_get_lines_from_handle, (HANDLE *handle, return lines; } -/** Read from stream, and send lines to log at the specified log level. - * Returns -1 if there is a error reading, and 0 otherwise. - * If the generated stream is flushed more often than on new lines, or - * a read exceeds 256 bytes, lines will be truncated. This should be fixed, - * along with the corresponding problem on *nix (see bug #2045). - */ -static int -log_from_handle(HANDLE *pipe, int severity) -{ - char buf[256]; - int pos; - smartlist_t *lines; - - pos = tor_read_all_handle(pipe, buf, sizeof(buf) - 1, NULL); - if (pos < 0) { - /* Error */ - log_warn(LD_GENERAL, "Failed to read data from subprocess"); - return -1; - } - - if (0 == pos) { - /* There's nothing to read (process is busy or has exited) */ - log_debug(LD_GENERAL, "Subprocess had nothing to say"); - return 0; - } - - /* End with a null even if there isn't a \r\n at the end */ - /* TODO: What if this is a partial line? */ - buf[pos] = '\0'; - log_debug(LD_GENERAL, "Subprocess had %d bytes to say", pos); - - /* Split up the buffer */ - lines = smartlist_new(); - tor_split_lines(lines, buf, pos); - - /* Log each line */ - SMARTLIST_FOREACH(lines, char *, line, - { - log_fn(severity, LD_GENERAL, "Port forwarding helper says: %s", line); - }); - smartlist_free(lines); - - return 0; -} - #else /* !(defined(_WIN32)) */ /** Return a smartlist containing lines outputted from |