Commit 5750426f authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(isc_flush): Inform the write change callback function of changes in

	the pending output queue size.
(isc_oflush): Ditto.
parent 18d58835
......@@ -57,13 +57,16 @@
void isc_flush(struct isc_scb *scb)
{
struct isc_scb_internal *sci = (struct isc_scb_internal*)scb;
int size;
switch (sci->state)
{
case ISC_STATE_CLOSING:
if (sci->wr_msg_q)
{
isc_killqueue(sci->wr_msg_q);
size = isc_killqueue(sci->wr_msg_q);
if (sci->pub.master->write_change_cb)
sci->pub.master->write_change_cb(-size);
sci->wr_msg_q = NULL;
}
sci->sendindex = 0;
......@@ -113,6 +116,8 @@ isc_oflush(struct isc_scb_internal *scb)
msg = isc_allocmsg(scb->sendindex);
memcpy(msg->buffer, scb->sendbuf, scb->sendindex);
msg->length = scb->sendindex;
if (scb->pub.master->write_change_cb)
scb->pub.master->write_change_cb(msg->length);
isc_pushqueue(scb->wr_msg_q, msg);
scb->sendindex = 0;
}
......@@ -152,7 +157,11 @@ isc_oflush(struct isc_scb_internal *scb)
}
}
else
{
any_written = 1;
if (scb->pub.master->write_change_cb)
scb->pub.master->write_change_cb(-wlen);
}
msg->length -= wlen;
if (msg->length > 0)
......
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