aboutsummaryrefslogtreecommitdiffstats
path: root/src/interface.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-01-27 23:10:45 +0000
committerEric Wong <normalperson@yhbt.net>2008-01-27 23:10:45 +0000
commitb1cbe333a6b55ed27c8ef9d8b2731eec5b3d4c30 (patch)
treea8bdd4dba55dc2659770b2da61dc62ac1c8f6bb0 /src/interface.c
parent2fcd63feb1fcbe3f1ce5f191aebff1979b8312cf (diff)
downloadmpd-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.c2
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) {