-LOCAL VOID Close_Connection( CONN_ID Idx, CHAR *Msg )
-{
- /* Verbindung schlie§en */
-
- assert( Idx >= 0 );
- assert( My_Connections[Idx].sock >= 0 );
-
- if( Msg ) Conn_WriteStr( Idx, "ERROR :%s", Msg );
-
- if( close( My_Connections[Idx].sock ) != 0 )
- {
- Log( LOG_ERR, "Error closing connection %d with %s:%d - %s!", Idx, inet_ntoa( My_Connections[Idx].addr.sin_addr ), ntohs( My_Connections[Idx].addr.sin_port), strerror( errno ));
- return;
- }
- else
- {
- Log( LOG_NOTICE, "Connection %d with %s:%d closed.", Idx, inet_ntoa( My_Connections[Idx].addr.sin_addr ), ntohs( My_Connections[Idx].addr.sin_port ));
- }
-
- Client_Destroy( Client_GetFromConn( Idx ));
-
- FD_CLR( My_Connections[Idx].sock, &My_Sockets );
- My_Connections[Idx].sock = NONE;
-} /* Close_Connection */
-
-