From b1cbe333a6b55ed27c8ef9d8b2731eec5b3d4c30 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 27 Jan 2008 23:10:45 +0000 Subject: 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 --- src/interface.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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) { -- cgit v1.2.3