tor/changes/bug14554
David Goulet 51f793e37e Fix possible infinite loop on pipe/sock_drain()
If the returned value of read/recv is 0 (meaning EOF), we'll end up in an
infinite loop (active wait) until something is written on the pipe which is
not really what we want here especially because those functions are called
from the main thread.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-30 15:05:18 -05:00

5 lines
230 B
Plaintext

o Major bugfix
- Possibility of an infinite loop if the returned value of the read/recv
was 0. A returned value of 0 means that we've reached the EOF thus the
pipe/sock is drained so return success not an error.