IRC_SERVER(): code cleanup, remove unneeded variable

This commit is contained in:
Alexander Barton 2009-09-11 00:41:12 +02:00
parent c191ea53a9
commit 3b37ad334b
1 changed files with 17 additions and 18 deletions

View File

@ -51,7 +51,6 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
{ {
char str[LINE_LEN]; char str[LINE_LEN];
CLIENT *from, *c; CLIENT *from, *c;
bool ok;
int i; int i;
CONN_ID con; CONN_ID con;
@ -97,25 +96,25 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
/* Is this server registering on our side, or are we connecting to /* Is this server registering on our side, or are we connecting to
* a remote server? */ * a remote server? */
con = Client_Conn( Client ); con = Client_Conn(Client);
if( Client_Token( Client ) != TOKEN_OUTBOUND ) if (Client_Token(Client) != TOKEN_OUTBOUND) {
{
/* Incoming connection, send user/pass */ /* Incoming connection, send user/pass */
ok = true; if (!IRC_WriteStrClient(Client, "PASS %s %s",
if( ! IRC_WriteStrClient( Client, "PASS %s %s", Conf_Server[i].pwd_out, NGIRCd_ProtoID )) ok = false; Conf_Server[i].pwd_out,
else ok = IRC_WriteStrClient( Client, "SERVER %s 1 :%s", Conf_ServerName, Conf_ServerInfo ); NGIRCd_ProtoID)
if( ! ok ) || !IRC_WriteStrClient(Client, "SERVER %s 1 :%s",
{ Conf_ServerName,
Conn_Close( con, "Unexpected server behavior!", NULL, false ); Conf_ServerInfo)) {
Conn_Close(con, "Unexpected server behavior!",
NULL, false);
return DISCONNECTED; return DISCONNECTED;
} }
Client_SetIntroducer( Client, Client ); Client_SetIntroducer(Client, Client);
Client_SetToken( Client, 1 ); Client_SetToken(Client, 1);
} } else {
else /* outgoing connect, we already sent a SERVER and PASS
{ * command to the peer */
/* outgoing connect, we already sent SERVER and PASS to the peer */ Client_SetToken(Client, atoi(Req->argv[1]));
Client_SetToken( Client, atoi( Req->argv[1] ));
} }
/* Mark this connection as belonging to an configured server */ /* Mark this connection as belonging to an configured server */