| 223 | stdout.flush() |
| 224 | |
| 225 | def _read_next_string_line(): |
| 226 | try: |
| 227 | line = stdin.readline(128) |
| 228 | if not line: |
| 229 | return # parent probably exited |
| 230 | return line.decode('ASCII').strip() |
| 231 | except IOError as e: |
| 232 | # On windows, ConnectionResetError is thrown when parent process closes it's socket pair end |
| 233 | debug3('read from stdin failed: %s' % (e,)) |
| 234 | return |
| 235 | # we wait until we get some input before creating the rules. That way, |
| 236 | # sshuttle can launch us as early as possible (and get sudo password |
| 237 | # authentication as early in the startup process as possible). |