| 58 | } |
| 59 | |
| 60 | static char *tor_response_line(struct rbuf *rbuf) |
| 61 | { |
| 62 | char *line; |
| 63 | |
| 64 | while ((line = rbuf_read_str(rbuf, '\n')) != NULL) { |
| 65 | status_io(LOG_IO_IN, NULL, "torcontrol", line, strlen(line)); |
| 66 | |
| 67 | /* Weird response */ |
| 68 | if (!strstarts(line, "250")) |
| 69 | status_failed(STATUS_FAIL_INTERNAL_ERROR, |
| 70 | "Tor returned '%s'", line); |
| 71 | |
| 72 | /* Last line */ |
| 73 | if (strstarts(line, "250 ")) |
| 74 | break; |
| 75 | |
| 76 | return line + 4; |
| 77 | } |
| 78 | return NULL; |
| 79 | } |
| 80 | |
| 81 | static void discard_remaining_response(struct rbuf *rbuf) |
| 82 | { |
no test coverage detected