summaryrefslogtreecommitdiff
path: root/omapip
diff options
context:
space:
mode:
authorShawn Routhier <sar@isc.org>2012-11-26 12:14:27 -0800
committerShawn Routhier <sar@isc.org>2012-11-26 12:14:27 -0800
commit1e2a127bfeb23448c2594167b9bf09f585a52259 (patch)
treefd07344b040a6203c1c47656a4c6c21df26b33d5 /omapip
parent9ff4e0a221e1f524dc746db4bf08f3ddfc6ecb28 (diff)
downloadisc-dhcp-1e2a127bfeb23448c2594167b9bf09f585a52259.tar.gz
[master]
[rt31231] Check the status when trying to read from a connection and don't ask for more if we seem to have a closed connection. [ISC-Bugs #31231]
Diffstat (limited to 'omapip')
-rw-r--r--omapip/dispatch.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/omapip/dispatch.c b/omapip/dispatch.c
index 4039659a..e6aae453 100644
--- a/omapip/dispatch.c
+++ b/omapip/dispatch.c
@@ -171,8 +171,15 @@ omapi_iscsock_cb(isc_task_t *task,
if ((flags == ISC_SOCKFDWATCH_READ) &&
(obj->reader != NULL) &&
(obj->inner != NULL)) {
- obj->reader(obj->inner);
- /* We always ask for more when reading */
+ status = obj->reader(obj->inner);
+ /*
+ * If we are shutting down (basically tried to
+ * read and got no bytes) we don't need to try
+ * again.
+ */
+ if (status == ISC_R_SHUTTINGDOWN)
+ return (0);
+ /* Otherwise We always ask for more when reading */
return (1);
} else if ((flags == ISC_SOCKFDWATCH_WRITE) &&
(obj->writer != NULL) &&