/*
* mo_connect - CONNECT command handler
- *
+ *
* Added by Jto 11 Feb 1989
*
* m_connect
- * parv[0] = sender prefix
* parv[1] = servername
* parv[2] = port number
* parv[3] = remote server
if((target_p = find_server(source_p, parv[1])))
{
- sendto_one_notice(source_p, ":Connect: Server %s already exists from %s.", parv[1],
+ sendto_one_notice(source_p, ":Connect: Server %s already exists from %s.", parv[1],
target_p->from->name);
return 0;
}
* use the default form configuration structure. If missing
* from there, then use the precompiled default.
*/
- tmpport = port = server_p->port;
+ tmpport = port = 0;
if(parc > 2 && !EmptyString(parv[2]))
+ port = atoi(parv[2]);
+ if(port == 0 && server_p->port)
+ port = server_p->port;
+ else if(port <= 0)
{
- if((port = atoi(parv[2])) <= 0)
- {
- sendto_one_notice(source_p, ":Connect: Illegal port number");
- return 0;
- }
- }
- else if(port <= 0 && (port = PORTNUM) <= 0)
- {
- sendto_one_notice(source_p, ":Connect: missing port number");
+ sendto_one_notice(source_p, ":Connect: illegal port number");
return 0;
}
+
/*
* Notify all operators about remote connect requests
*/
- ilog(L_SERVER, "CONNECT From %s : %s %s", parv[0], parv[1], parc > 2 ? parv[2] : "");
+ ilog(L_SERVER, "CONNECT From %s : %s %s", source_p->name, parv[1], parc > 2 ? parv[2] : "");
server_p->port = port;
/*
*/
if(serv_connect(server_p, source_p))
{
-#ifndef HIDE_SERVERS_IPS
- sendto_one_notice(source_p, ":*** Connecting to %s[%s].%d",
- server_p->host, server_p->name, server_p->port);
-#else
sendto_one_notice(source_p, ":*** Connecting to %s.%d",
server_p->name, server_p->port);
-#endif
-
}
else
{
/*
* ms_connect - CONNECT command handler
- *
+ *
* Added by Jto 11 Feb 1989
*
* m_connect
- * parv[0] = sender prefix
* parv[1] = servername
* parv[2] = port number
* parv[3] = remote server
* Notify all operators about remote connect requests
*/
sendto_wallops_flags(UMODE_WALLOP, &me,
- "Remote CONNECT %s %d from %s",
+ "Remote CONNECT %s %d from %s",
parv[1], port, source_p->name);
sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
":%s WALLOPS :Remote CONNECT %s %d from %s",
me.id, parv[1], port, source_p->name);
- sendto_server(NULL, NULL, NOCAPS, CAP_TS6,
- ":%s WALLOPS :Remote CONNECT %s %d from %s",
- me.name, parv[1], port, source_p->name);
ilog(L_SERVER, "CONNECT From %s : %s %d", source_p->name, parv[1], port);