summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-29 19:34:18 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-29 19:34:18 +0000
commitf278bdbbad200b5424c5721ac85ee3dd8d982d60 (patch)
tree1f3a83005df38bacee4281ee21706c64a2871082 /src
parentee9f5d77844c37a98aadfea8677d58e30b6a3dc9 (diff)
Changed to MAX_DESCRIPTORS
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2700 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/command_parse.cpp4
-rw-r--r--src/dnsqueue.cpp4
-rw-r--r--src/inspircd.cpp4
-rw-r--r--src/socket.cpp2
-rw-r--r--src/socketengine.cpp14
-rw-r--r--src/users.cpp4
6 files changed, 16 insertions, 16 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index cd1faa885..cacc1d16a 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -75,13 +75,13 @@ extern std::vector<InspSocket*> module_sockets;
extern std::vector<userrec*> local_users;
extern int MODCOUNT;
-extern InspSocket* socket_ref[65535];
+extern InspSocket* socket_ref[MAX_DESCRIPTORS];
extern time_t TIME;
// This table references users by file descriptor.
// its an array to make it VERY fast, as all lookups are referenced
// by an integer, meaning there is no need for a scan/search operation.
-extern userrec* fd_ref_table[65536];
+extern userrec* fd_ref_table[MAX_DESCRIPTORS];
extern Server* MyServer;
extern ServerConfig *Config;
diff --git a/src/dnsqueue.cpp b/src/dnsqueue.cpp
index 8ea0f3ec3..1495316c5 100644
--- a/src/dnsqueue.cpp
+++ b/src/dnsqueue.cpp
@@ -55,7 +55,7 @@ extern InspIRCd* ServerInstance;
class Lookup;
-Lookup* dnslist[65535];
+Lookup* dnslist[MAX_DESCRIPTORS];
//enum LookupState { reverse, forward };
@@ -225,7 +225,7 @@ bool lookup_dns(std::string nick)
void dns_poll(int fdcheck)
{
/* Check the given file descriptor is in valid range */
- if ((fdcheck < 0) || (fdcheck > 65535))
+ if ((fdcheck < 0) || (fdcheck > MAX_DESCRIPTORS))
return;
/* Try and find the file descriptor in our list of
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index fbcfc12d1..dc3c777fe 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -76,7 +76,7 @@ int openSockfd[MAXSOCKS];
sockaddr_in client,server;
socklen_t length;
-extern InspSocket* socket_ref[65535];
+extern InspSocket* socket_ref[MAX_DESCRIPTORS];
time_t TIME = time(NULL), OLDTIME = time(NULL);
@@ -408,7 +408,7 @@ bool InspIRCd::LoadModule(const char* filename)
int InspIRCd::Run()
{
bool expire_run = false;
- int activefds[65535];
+ int activefds[MAX_DESCRIPTORS];
int incomingSockfd;
int in_port;
userrec* cu = NULL;
diff --git a/src/socket.cpp b/src/socket.cpp
index 6d065e835..fd6b68006 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -40,7 +40,7 @@ using namespace std;
extern InspIRCd* ServerInstance;
extern time_t TIME;
-InspSocket* socket_ref[65535];
+InspSocket* socket_ref[MAX_DESCRIPTORS];
InspSocket::InspSocket()
{
diff --git a/src/socketengine.cpp b/src/socketengine.cpp
index 69838ff59..ceb1090f1 100644
--- a/src/socketengine.cpp
+++ b/src/socketengine.cpp
@@ -29,13 +29,13 @@
#include <string>
#include "socketengine.h"
-char ref[65535];
+char ref[MAX_DESCRIPTORS];
SocketEngine::SocketEngine()
{
log(DEBUG,"SocketEngine::SocketEngine()");
#ifdef USE_EPOLL
- EngineHandle = epoll_create(65535);
+ EngineHandle = epoll_create(MAX_DESCRIPTORS);
#endif
#ifdef USE_KQUEUE
EngineHandle = kqueue();
@@ -56,7 +56,7 @@ SocketEngine::~SocketEngine()
char SocketEngine::GetType(int fd)
{
- if ((fd < 0) || (fd > 65535))
+ if ((fd < 0) || (fd > MAX_DESCRIPTORS))
return X_EMPTY_SLOT;
/* Mask off the top bit used for 'read/write' state */
return (ref[fd] & ~0x80);
@@ -64,7 +64,7 @@ char SocketEngine::GetType(int fd)
bool SocketEngine::AddFd(int fd, bool readable, char type)
{
- if ((fd < 0) || (fd > 65535))
+ if ((fd < 0) || (fd > MAX_DESCRIPTORS))
return false;
if (GetRemainingFds() <= 1)
{
@@ -112,7 +112,7 @@ bool SocketEngine::DelFd(int fd)
{
log(DEBUG,"SocketEngine::DelFd(%d)",fd);
- if ((fd < 0) || (fd > 65535))
+ if ((fd < 0) || (fd > MAX_DESCRIPTORS))
return false;
#ifdef USE_SELECT
@@ -210,12 +210,12 @@ int SocketEngine::Wait(int* fdlist)
#ifdef USE_KQUEUE
ts.tv_nsec = 10000L;
ts.tv_sec = 0;
- int i = kevent(EngineHandle, NULL, 0, &ke_list[0], 65535, &ts);
+ int i = kevent(EngineHandle, NULL, 0, &ke_list[0], MAX_DESCRIPTORS, &ts);
for (int j = 0; j < i; j++)
fdlist[result++] = ke_list[j].ident;
#endif
#ifdef USE_EPOLL
- int i = epoll_wait(EngineHandle, events, 65535, 100);
+ int i = epoll_wait(EngineHandle, events, MAX_DESCRIPTORS, 100);
for (int j = 0; j < i; j++)
fdlist[result++] = events[j].data.fd;
#endif
diff --git a/src/users.cpp b/src/users.cpp
index cf93ff198..8bd8104d0 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -44,9 +44,9 @@ extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
extern std::vector<InspSocket*> module_sockets;
extern int MODCOUNT;
-extern InspSocket* socket_ref[65535];
+extern InspSocket* socket_ref[MAX_DESCRIPTORS];
extern time_t TIME;
-extern userrec* fd_ref_table[65536];
+extern userrec* fd_ref_table[MAX_DESCRIPTORS];
extern ServerConfig *Config;
extern user_hash clientlist;
extern whowas_hash whowas;