Fixed to not crash on /PARK (still more to test)

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2729 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
brain 2006-01-03 18:26:25 +00:00
parent 882208fc76
commit c992372f80
2 changed files with 5 additions and 2 deletions

View File

@ -81,6 +81,8 @@ extern chan_hash chanlist;
void ProcessUser(userrec* cu) void ProcessUser(userrec* cu)
{ {
int result = EAGAIN; int result = EAGAIN;
if (cu->fd == FD_MAGIC_NUMBER)
return;
log(DEBUG,"Processing user with fd %d",cu->fd); log(DEBUG,"Processing user with fd %d",cu->fd);
if (Config->GetIOHook(cu->port)) if (Config->GetIOHook(cu->port))
{ {

View File

@ -284,7 +284,7 @@ void userrec::AddWriteBuf(std::string data)
// send AS MUCH OF THE USERS SENDQ as we are able to (might not be all of it) // send AS MUCH OF THE USERS SENDQ as we are able to (might not be all of it)
void userrec::FlushWriteBuf() void userrec::FlushWriteBuf()
{ {
if (sendq.length()) if ((sendq.length()) && (this->fd != FD_MAGIC_NUMBER))
{ {
char* tb = (char*)this->sendq.c_str(); char* tb = (char*)this->sendq.c_str();
int n_sent = write(this->fd,tb,this->sendq.length()); int n_sent = write(this->fd,tb,this->sendq.length());
@ -467,7 +467,8 @@ void AddWhoWas(userrec* u)
strlcpy(a->dhost,u->dhost,160); strlcpy(a->dhost,u->dhost,160);
strlcpy(a->host,u->host,160); strlcpy(a->host,u->host,160);
strlcpy(a->fullname,u->fullname,MAXGECOS); strlcpy(a->fullname,u->fullname,MAXGECOS);
strlcpy(a->server,u->server,256); if (u->server)
strlcpy(a->server,u->server,256);
a->signon = u->signon; a->signon = u->signon;
/* MAX_WHOWAS: max number of /WHOWAS items /* MAX_WHOWAS: max number of /WHOWAS items