* ---------------------------------------------------
*/
-#include "inspircd_config.h"
-#include "globals.h"
#include "inspircd.h"
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
-#include <vector>
-#include <string>
#include "socketengine_kqueue.h"
bool KQueueEngine::AddFd(EventHandler* eh)
{
int fd = eh->GetFd();
+
+ ServerInstance->Log(DEFAULT,"KQueueEngine::AddFd(%d)",fd);
+
if ((fd < 0) || (fd > MAX_DESCRIPTORS))
{
ServerInstance->Log(DEFAULT,"ERROR: FD of %d added above max of %d",fd,MAX_DESCRIPTORS);
}
if (ref[fd])
+ {
+ ServerInstance->Log(DEFAULT,"ERROR: Slot already occupied");
return false;
+ }
ref[fd] = eh;
ServerInstance->Log(DEBUG,"Add socket %d",fd);