Sebastian Lackner sebastian@fds-team.de writes:
The condition "prev_fd != -1" should never be true. If this is the case then something is going terrible wrong, and it is better to assert instead of just closing the file descriptor.
It can happen if the handle was closed on the server side but not yet removed from the cache. Yes, handling of that case is not ideal, but an assert is not an improvement.