X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-server.c;h=f1b817c033dd2bcdb0d84246bcc4f6b8c6d8bfa5;hb=0e4e22a7a671d1e8efbc44bffd80062191f75c38;hp=d342ffab754f463ce423f842c41f56e9f37c192c;hpb=47ca178a219d682c589b27e64ee1a4e936cc7bdc;p=ngircd-alex.git diff --git a/src/ngircd/irc-server.c b/src/ngircd/irc-server.c index d342ffab..f1b817c0 100644 --- a/src/ngircd/irc-server.c +++ b/src/ngircd/irc-server.c @@ -14,8 +14,6 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-server.c,v 1.46 2007/11/21 12:16:36 alex Exp $"; - #include "imp.h" #include #include @@ -26,6 +24,7 @@ static char UNUSED id[] = "$Id: irc-server.c,v 1.46 2007/11/21 12:16:36 alex Exp #include "defines.h" #include "resolve.h" #include "conn.h" +#include "conn-func.h" #include "conn-zip.h" #include "conf.h" #include "client.h" @@ -64,7 +63,8 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) return IRC_WriteStrClient(Client, ERR_UNKNOWNCOMMAND_MSG, Client_ID(Client), Req->command); - if (Client_Type(Client) == CLIENT_GOTPASS) { + if (Client_Type(Client) == CLIENT_GOTPASS || + Client_Type(Client) == CLIENT_GOTPASS_2813) { /* We got a PASS command from the peer, and now a SERVER * command: the peer tries to register itself as a server. */ LogDebug("Connection %d: got SERVER command (new server link) ...", @@ -124,7 +124,18 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) /* Mark this connection as belonging to an configured server */ Conf_SetServer(i, con); - + + /* Check protocol level */ + if (Client_Type(Client) == CLIENT_GOTPASS) { + /* We got a "simple" PASS command, so the peer is + * using the protocol as defined in RFC 1459. */ + if (! (Conn_Options(con) & CONN_RFC1459)) + Log(LOG_INFO, + "Switching connection %d (\"%s\") to RFC 1459 compatibility mode.", + con, Client_ID(Client)); + Conn_SetOption(con, CONN_RFC1459); + } + Client_SetType(Client, CLIENT_UNKNOWNSERVER); #ifdef ZLIB