aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-01-27 23:12:39 +0000
committerEric Wong <normalperson@yhbt.net>2008-01-27 23:12:39 +0000
commit639a1c88df31e517f0a1cd68ad76f9d71459f892 (patch)
tree549ffe0c4e302c80b2232ee2f3ae113c38c12e79
parentb97139a13b5b55da1858428c6dc802b5b50ffc9f (diff)
downloadmpd-639a1c88df31e517f0a1cd68ad76f9d71459f892.tar.gz
mpd-639a1c88df31e517f0a1cd68ad76f9d71459f892.tar.xz
mpd-639a1c88df31e517f0a1cd68ad76f9d71459f892.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/branches/branch-0.13.0-fixes@7175 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/interface.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/interface.c b/src/interface.c
index 22660432f..e79269002 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -388,6 +388,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) {