-LOCAL VOID Close_Connection( CONN_ID Idx, CHAR *Msg )
-{
- /* Verbindung schlie§en */
-
- CHAR bye_str[MAX_CMDLEN];
-
- assert( Idx >= 0 );
- assert( My_Connections[Idx].sock >= 0 );
-
- if( Msg )
- {
- sprintf( bye_str, "ERROR :%s", Msg );
- Conn_WriteStr( Idx, bye_str );
- }
-
- 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 ));
- }
- else
- {
- Log( LOG_NOTICE, "Closed connection %d with %s:%d.", Idx, inet_ntoa( My_Connections[Idx].addr.sin_addr ), ntohs( My_Connections[Idx].addr.sin_port ));
- }
-
- FD_CLR( My_Connections[Idx].sock, &My_Sockets );
- My_Connections[Idx].sock = NONE;
-} /* Close_Connection */
-
-