Commit a0fc8a90 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(isc_check_read_callback): Don't crash if wr_msg_q is NULL.

(isc_check_read_callback): Don't setup any callbacks in
	ISC_STATE_CLOSING.
parent 83e85d51
......@@ -297,8 +297,9 @@ isc_check_read_callback(struct isc_scb_internal *session,
/* Too many queued blocks or bytes? Don't read any more data, until
the client has read the output we have already produced. */
if (isc_sizequeue(session->wr_msg_q) >= session->cfg->max.queuedsize
|| session->wr_msg_q->bytes >= session->cfg->max.queuedsize_bytes)
if (session->wr_msg_q != NULL
&& (isc_sizequeue(session->wr_msg_q) >= session->cfg->max.queuedsize
|| session->wr_msg_q->bytes >= session->cfg->max.queuedsize_bytes))
{
want_read = 0;
want_write_timeout = 1;
......@@ -307,6 +308,13 @@ isc_check_read_callback(struct isc_scb_internal *session,
if (session->state == ISC_STATE_DISABLED)
want_read = 0;
/* If this session is closing down there is no need for callbacks. */
if (session->state == ISC_STATE_CLOSING)
{
want_read = 0;
want_write_timeout = 0;
}
if (!want_read)
isc_cancel_read_callback(session);
else if (!session->data_available_registered
......@@ -334,7 +342,7 @@ isc_check_read_callback(struct isc_scb_internal *session,
session->stale_output_cb_registered = 1;
}
if (!session->idle_cb_registered)
if (!session->idle_cb_registered && session->state != ISC_STATE_CLOSING)
{
setup_timer(&session->idle_tv, session->acceptable_idle_time);
source->on_time(source, session->idle_tv, idle_cb, session);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment