diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-01-27 23:10:45 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-01-27 23:10:45 +0000 |
commit | b1cbe333a6b55ed27c8ef9d8b2731eec5b3d4c30 (patch) | |
tree | a8bdd4dba55dc2659770b2da61dc62ac1c8f6bb0 /src | |
parent | 2fcd63feb1fcbe3f1ce5f191aebff1979b8312cf (diff) | |
download | mpd-b1cbe333a6b55ed27c8ef9d8b2731eec5b3d4c30.tar.gz mpd-b1cbe333a6b55ed27c8ef9d8b2731eec5b3d4c30.tar.xz mpd-b1cbe333a6b55ed27c8ef9d8b2731eec5b3d4c30.zip |
interface: abort if we expire while processing lines
If we keep processing expired interfaces in a loop,
we'll eventually close it and get fd < 0, causing
assertions to fail.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7168 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/interface.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/interface.c b/src/interface.c index 289ed8066..7dbcd2dc3 100644 --- a/src/interface.c +++ b/src/interface.c @@ -367,6 +367,8 @@ static int processBytesRead(Interface * interface, int bytesRead) *(buf_tail - 1) = '\0'; } ret = processLineOfInput(interface); + if (interface->expired) + return ret; interface->bufferPos = interface->bufferLength; } if (interface->bufferLength == INTERFACE_MAX_BUFFER_LENGTH) { |