ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/conf_parser.y
(Generate patch)

Comparing ircd-hybrid/trunk/src/conf_parser.y (file contents):
Revision 1715 by michael, Mon Dec 24 15:19:32 2012 UTC vs.
Revision 1736 by michael, Sun Jan 13 09:31:46 2013 UTC

# Line 741 | Line 741 | serverinfo_vhost6: VHOST6 '=' QSTRING ';
741  
742   serverinfo_max_clients: T_MAX_CLIENTS '=' NUMBER ';'
743   {
744 <  if (conf_parser_ctx.pass == 2)
744 >  if (conf_parser_ctx.pass != 2)
745 >    break;
746 >
747 >  if ($3 < MAXCLIENTS_MIN)
748 >  {
749 >    char buf[IRCD_BUFSIZE];
750 >
751 >    snprintf(buf, sizeof(buf), "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN);
752 >    yyerror(buf);
753 >    ServerInfo.max_clients = MAXCLIENTS_MIN;
754 >  }
755 >  else if ($3 > MAXCLIENTS_MAX)
756    {
757 <    recalc_fdlimit(NULL);
757 >    char buf[IRCD_BUFSIZE];
758  
759 <    if ($3 < MAXCLIENTS_MIN)
760 <    {
761 <      char buf[IRCD_BUFSIZE];
751 <      ircsprintf(buf, "MAXCLIENTS too low, setting to %d", MAXCLIENTS_MIN);
752 <      yyerror(buf);
753 <    }
754 <    else if ($3 > MAXCLIENTS_MAX)
755 <    {
756 <      char buf[IRCD_BUFSIZE];
757 <      ircsprintf(buf, "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX);
758 <      yyerror(buf);
759 <    }
760 <    else
761 <      ServerInfo.max_clients = $3;
759 >    snprintf(buf, sizeof(buf), "MAXCLIENTS too high, setting to %d", MAXCLIENTS_MAX);
760 >    yyerror(buf);
761 >    ServerInfo.max_clients = MAXCLIENTS_MAX;
762    }
763 +  else
764 +    ServerInfo.max_clients = $3;
765   };
766  
767   serverinfo_hub: HUB '=' TBOOL ';'

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)