(sock)
| 329 | hw.leftover = b('') |
| 330 | |
| 331 | def hostwatch_ready(sock): |
| 332 | assert hw.pid |
| 333 | content = hw.sock.recv(4096) |
| 334 | if content: |
| 335 | lines = (hw.leftover + content).split(b('\n')) |
| 336 | if lines[-1]: |
| 337 | # no terminating newline: entry isn't complete yet! |
| 338 | hw.leftover = lines.pop() |
| 339 | lines.append(b('')) |
| 340 | else: |
| 341 | hw.leftover = b('') |
| 342 | mux.send(0, ssnet.CMD_HOST_LIST, b('\n').join(lines)) |
| 343 | else: |
| 344 | raise Fatal('hostwatch process died') |
| 345 | |
| 346 | def got_host_req(data): |
| 347 | if not hw.pid: |