From: Pekka Riikonen Date: Tue, 12 Nov 2002 12:45:03 +0000 (+0000) Subject: Clear outbuf even if error occurred in packet sending X-Git-Tag: silc.server.0.9.6~56 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=e8cc5248efb05480ca102e9334a0f33f047eab67 Clear outbuf even if error occurred in packet sending --- diff --git a/apps/silcd/server.c b/apps/silcd/server.c index 5656be0b..c58e5a6f 100644 --- a/apps/silcd/server.c +++ b/apps/silcd/server.c @@ -2184,6 +2184,14 @@ SILC_TASK_CALLBACK(silc_server_packet_process) if (ret == -2) return; + /* The packet has been sent and now it is time to set the connection + back to only for input. When there is again some outgoing data + available for this connection it will be set for output as well. + This call clears the output setting and sets it only for input. */ + SILC_SET_CONNECTION_FOR_INPUT(server->schedule, fd); + SILC_UNSET_OUTBUF_PENDING(sock); + silc_buffer_clear(sock->outbuf); + if (ret == -1) { SILC_LOG_ERROR(("Error sending packet to connection " "%s:%d [%s]", sock->hostname, sock->port, @@ -2191,17 +2199,7 @@ SILC_TASK_CALLBACK(silc_server_packet_process) sock->type == SILC_SOCKET_TYPE_CLIENT ? "Client" : sock->type == SILC_SOCKET_TYPE_SERVER ? "Server" : "Router"))); - return; } - - /* The packet has been sent and now it is time to set the connection - back to only for input. When there is again some outgoing data - available for this connection it will be set for output as well. - This call clears the output setting and sets it only for input. */ - SILC_SET_CONNECTION_FOR_INPUT(server->schedule, fd); - SILC_UNSET_OUTBUF_PENDING(sock); - - silc_buffer_clear(sock->outbuf); return; }