/* Packet sending */
if (type == SILC_TASK_WRITE) {
+ /* Do not send data to disconnected connection */
+ if (SILC_IS_DISCONNECTED(sock))
+ return;
+
server->stat.packets_sent++;
if (sock->outbuf->data - sock->outbuf->head)
}
SILC_LOG_DEBUG(("Premature EOF from connection %d", sock->sock));
+ SILC_SET_DISCONNECTING(sock);
/* If the closed connection was our primary router connection the
start re-connecting phase. */
/* If connection is disconnecting or disconnected we will ignore
what we read. */
if (SILC_IS_DISCONNECTING(sock) || SILC_IS_DISCONNECTED(sock)) {
- SILC_LOG_DEBUG(("Ignoring read data from invalid connection"));
+ SILC_LOG_DEBUG(("Ignoring read data from disonnected connection"));
return;
}