* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
- * $Id: s_serv.c 3183 2007-02-01 01:07:42Z jilles $
+ * $Id: s_serv.c 3550 2007-08-09 06:47:26Z nenolod $
*/
#include "stdinc.h"
#include "channel.h" /* chcap_usage_counts stuff... */
#include "hook.h"
#include "msg.h"
+#include "reject.h"
extern char *crypt();
target_p->name, target_p->hopcount + 1,
(long) target_p->tsinfo, ubuf,
target_p->username, target_p->host,
- target_p->user->server, target_p->info);
+ target_p->servptr->name, target_p->info);
if(IsDynSpoof(target_p))
sendto_one(client_p, ":%s ENCAP * REALHOST %s",
(long) target_p->tsinfo,
ubuf,
target_p->username, target_p->host,
- target_p->user->server, target_p->info);
+ target_p->servptr->name, target_p->info);
if(!has_id(target_p) || !IsCapable(client_p, CAP_EUID))
{
*/
if(!EmptyString(server_p->spasswd))
{
- /* kludge, if we're not using TS6, dont ever send
- * ourselves as being TS6 capable.
- */
- if(ServerInfo.use_ts6)
- sendto_one(client_p, "PASS %s TS %d :%s",
- server_p->spasswd, TS_CURRENT, me.id);
- else
- sendto_one(client_p, "PASS %s :TS",
- server_p->spasswd);
+ sendto_one(client_p, "PASS %s TS %d :%s",
+ server_p->spasswd, TS_CURRENT, me.id);
}
/* pass info to new server */
set_chcap_usage_counts(client_p);
dlinkAdd(client_p, &client_p->lnode, &me.serv->servers);
+ del_unknown_ip(client_p);
dlinkMoveNode(&client_p->localClient->tnode, &unknown_list, &serv_list);
dlinkAddTailAlloc(client_p, &global_serv_list);
add_to_client_hash(client_p->name, client_p);
/* doesnt duplicate client_p->serv if allocated this struct already */
make_server(client_p);
- client_p->serv->up = me.name;
- client_p->serv->upid = me.id;
client_p->serv->caps = client_p->localClient->caps;
client_p->localClient->fullcaps = NULL;
}
- /* add it to scache */
- find_or_add(client_p->name);
+ client_p->serv->nameinfo = scache_connect(client_p->name, client_p->info, IsHidden(client_p));
client_p->localClient->firsttime = CurrentTime;
/* fixing eob timings.. -gnp */
+ if((dlink_list_length(&lclient_list) + dlink_list_length(&serv_list)) >
+ (unsigned long)MaxConnectionCount)
+ MaxConnectionCount = dlink_list_length(&lclient_list) +
+ dlink_list_length(&serv_list);
+
/* Show the real host/IP to admins */
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"Link with %s established: (%s) link",
/* presumption, if target has an id, so does its uplink */
if(has_id(client_p) && has_id(target_p))
sendto_one(client_p, ":%s SID %s %d %s :%s%s",
- target_p->serv->upid, target_p->name,
+ target_p->servptr->id, target_p->name,
target_p->hopcount + 1, target_p->id,
IsHidden(target_p) ? "(H) " : "", target_p->info);
else
sendto_one(client_p, ":%s SERVER %s %d :%s%s",
- target_p->serv->up,
+ target_p->servptr->name,
target_p->name, target_p->hopcount + 1,
IsHidden(target_p) ? "(H) " : "", target_p->info);
goto fork_error;
else if(ret == 0)
{
+ int maxconn = comm_get_maxconnections();
+
/* set our fds as non blocking and close everything else */
- for (i = 0; i < HARD_FDLIMIT; i++)
+ for (i = 0; i < maxconn; i++)
{
free_user(client_p->serv->user, NULL);
client_p->serv->user = NULL;
}
- client_p->serv->up = me.name;
- client_p->serv->upid = me.id;
SetConnecting(client_p);
dlinkAddTail(client_p, &client_p->node, &global_client_list);
struct Client *client_p = data;
struct server_conf *server_p;
char *errstr;
+ fde_t *F = comm_locate_fd(fd);
/* First, make sure its a real client! */
s_assert(client_p != NULL);
}
/* Next, for backward purposes, record the ip of the server */
- memcpy(&client_p->localClient->ip, &fd_table[fd].connect.hostaddr, sizeof client_p->localClient->ip);
+ memcpy(&client_p->localClient->ip, &F->connect.hostaddr, sizeof client_p->localClient->ip);
/* Set sockhost properly now -- jilles */
- inetntop_sock((struct sockaddr *)&fd_table[fd].connect.hostaddr,
+ inetntop_sock((struct sockaddr *)&F->connect.hostaddr,
client_p->sockhost, sizeof client_p->sockhost);
/* Check the status */
*/
if(!EmptyString(server_p->spasswd))
{
- if(ServerInfo.use_ts6)
- sendto_one(client_p, "PASS %s TS %d :%s",
- server_p->spasswd, TS_CURRENT, me.id);
- else
- sendto_one(client_p, "PASS %s :TS",
- server_p->spasswd);
+ sendto_one(client_p, "PASS %s TS %d :%s",
+ server_p->spasswd, TS_CURRENT, me.id);
}
/* pass my info to the new server */