Browse Source

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.
Nick Mathewson 6 years ago
parent
commit
d3b9b5a3dd
1 changed files with 0 additions and 45 deletions
  1. 0 45
      src/common/util.c

+ 0 - 45
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