diff options
author | Shawn Routhier <sar@isc.org> | 2012-11-26 12:14:27 -0800 |
---|---|---|
committer | Shawn Routhier <sar@isc.org> | 2012-11-26 12:14:27 -0800 |
commit | 1e2a127bfeb23448c2594167b9bf09f585a52259 (patch) | |
tree | fd07344b040a6203c1c47656a4c6c21df26b33d5 /omapip | |
parent | 9ff4e0a221e1f524dc746db4bf08f3ddfc6ecb28 (diff) | |
download | isc-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.c | 11 |
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) && |