X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=87dfca4abc0c41cc3a5cb88d8c2e5f240433c778;hb=8f9d0a68cd77b6a78eccfa7df9c1045d453ce581;hp=be24db6971007336981749ea2ff23d2df3b73eb1;hpb=a7b0c26a4c56440e4bc5ddc6d3ecfeb36089dbb2;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index be24db697..87dfca4ab 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -14,9 +14,8 @@ * --------------------------------------------------- */ -using namespace std; - -#include "inspircd_config.h" +#include "inspircd_config.h" +#include "configreader.h" #include "channels.h" #include "connection.h" #include "users.h" @@ -140,7 +139,7 @@ userrec::~userrec() for (std::vector::iterator n = chans.begin(); n != chans.end(); n++) { ucrec* x = (ucrec*)*n; - delete x; + DELETE(x); } } @@ -404,9 +403,8 @@ void userrec::AddWriteBuf(const std::string &data) WriteOpers("*** User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->sendqmax); return; } - std::stringstream stream; - stream << sendq << data; - sendq = stream.str(); + + sendq.append(data); } // send AS MUCH OF THE USERS SENDQ as we are able to (might not be all of it) @@ -418,7 +416,8 @@ void userrec::FlushWriteBuf() int n_sent = write(this->fd,tb,this->sendq.length()); if (n_sent == -1) { - this->SetWriteError(strerror(errno)); + if (errno != EAGAIN) + this->SetWriteError(strerror(errno)); } else { @@ -482,7 +481,7 @@ void kill_link(userrec *user,const char* r) char reason[MAXBUF]; strlcpy(reason,r,MAXQUIT-1); - log(DEBUG,"kill_link: %s '%s'",user->nick,reason); + log(DEBUG,"kill_link: %s %d '%s'",user->nick,user->fd,reason); if (IS_LOCAL(user)) Write(user->fd,"ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,reason); @@ -545,7 +544,7 @@ void kill_link(userrec *user,const char* r) } } clientlist.erase(iter); - delete user; + DELETE(user); } } @@ -589,7 +588,7 @@ void AddWhoWas(userrec* u) if (group->size() > 10) { WhoWasGroup *a = (WhoWasGroup*)*(group->begin()); - delete a; + DELETE(a); group->pop_front(); } @@ -609,7 +608,7 @@ void MaintainWhoWas(time_t TIME) while ((n->begin() != n->end()) && ((*n->begin())->signon < TIME - 259200)) // 3 days { WhoWasGroup *a = *(n->begin()); - delete a; + DELETE(a); n->erase(n->begin()); } } @@ -636,7 +635,7 @@ void AddClient(int socket, int port, bool iscached, in_addr ip4) if (iter != clientlist.end()) { userrec* goner = iter->second; - delete goner; + DELETE(goner); clientlist.erase(iter); } @@ -732,7 +731,10 @@ void AddClient(int socket, int port, bool iscached, in_addr ip4) } } - ServerInstance->SE->AddFd(socket,true,X_ESTAB_CLIENT); + if (socket > -1) + { + ServerInstance->SE->AddFd(socket,true,X_ESTAB_CLIENT); + } WriteServ(clientlist[tempnick]->fd,"NOTICE Auth :*** Looking up your hostname..."); } @@ -809,7 +811,7 @@ void FullConnectUser(userrec* user, CullList* Goners) return; } - r = matches_kline(user->host); + r = matches_kline(match_against); if (r) {