]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/s_serv.c
[svn] - remove ALL braindead 2.8 I/O artifacts: MASTER_MAX, HARD_FDLIMIT, HARD_FDLIMI...
[irc/rqf/shadowircd.git] / src / s_serv.c
index e4869dc10dc36fd2b23dacf998298eec420ed5a3..86b4bfe6a69a93fdee092a6b218ce6fd37d98a06 100644 (file)
@@ -21,7 +21,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: s_serv.c 2723 2006-11-09 23:35:48Z jilles $
+ *  $Id: s_serv.c 3354 2007-04-03 09:21:31Z nenolod $
  */
 
 #include "stdinc.h"
@@ -260,8 +260,7 @@ hunt_server(struct Client *client_p, struct Client *source_p,
         * Assume it's me, if no server
         */
        if(parc <= server || EmptyString(parv[server]) ||
-          match(me.name, parv[server]) || match(parv[server], me.name) ||
-          (strcmp(parv[server], me.id) == 0))
+          match(parv[server], me.name) || (strcmp(parv[server], me.id) == 0))
                return (HUNTED_ISME);
        
        new = LOCAL_COPY(parv[server]);
@@ -280,10 +279,6 @@ hunt_server(struct Client *client_p, struct Client *source_p,
                if(target_p->from == source_p->from && !MyConnect(target_p))
                        target_p = NULL;
 
-       if(target_p == NULL && (target_p = find_server(source_p, new)))
-               if(target_p->from == source_p->from && !MyConnect(target_p))
-                       target_p = NULL;
-
        collapse(new);
        wilds = (strchr(new, '?') || strchr(new, '*'));
 
@@ -1373,8 +1368,10 @@ fork_server(struct Client *server)
                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++)
                {
                                
 
@@ -1636,6 +1633,7 @@ serv_connect_callback(int fd, int status, void *data)
        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);
@@ -1654,9 +1652,9 @@ serv_connect_callback(int fd, int status, void *data)
        }
 
        /* 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 */