diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-04-22 19:40:58 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-04-22 19:40:58 +0000 |
commit | 531cba9251d2b7963f34047d5587678e3da076da (patch) | |
tree | 5330581b8b6392f51799c3fcfccafbac17163dd1 /src | |
parent | 752e87a9f0aa58a982949a95d7512801cc26fc00 (diff) |
Actually use readtimeout from the config & fixed many valgrind errors
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2905 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/botserv.c | 12 | ||||
-rw-r--r-- | src/channels.c | 6 | ||||
-rw-r--r-- | src/module.cpp | 1 | ||||
-rw-r--r-- | src/sockets.cpp | 2 |
4 files changed, 11 insertions, 10 deletions
diff --git a/src/botserv.c b/src/botserv.c index 5d4173d20..3f535783a 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -585,17 +585,17 @@ static UserData *get_user_data(Channel *c, User *u) time_t now = time(NULL); /* Checks whether data is obsolete */ - if (now - uc->ud->last_use > Config.BSKeepData) + if (now - uc->ud.last_use > Config.BSKeepData) { - if (uc->ud->lastline) - delete [] uc->ud->lastline; + if (uc->ud.lastline) + delete [] uc->ud.lastline; /* We should not free and realloc, but reset to 0 instead. */ - memset(uc->ud, 0, sizeof(UserData)); - uc->ud->last_use = now; + memset(&uc->ud, 0, sizeof(UserData)); + uc->ud.last_use = now; } - return uc->ud; + return &uc->ud; } } diff --git a/src/channels.c b/src/channels.c index 60deace17..62dfc797b 100644 --- a/src/channels.c +++ b/src/channels.c @@ -46,7 +46,7 @@ Channel::Channel(const std::string &name, time_t ts) this->bans = this->excepts = this->invites = NULL; this->bd = NULL; this->server_modetime = this->chanserv_modetime = 0; - this->server_modecount = this->chanserv_modecount = this->bouncy_modes = this->topic_sync = 0; + this->server_modecount = this->chanserv_modecount = this->bouncy_modes = this->topic_sync = this->topic_time = 0; this->ci = cs_findchan(this->name); if (this->ci) @@ -1138,8 +1138,8 @@ void get_channel_stats(long *nrec, long *memuse) { mem += sizeof(*it); mem += sizeof((*it)->ud); - if ((*it)->ud->lastline) - mem += strlen((*it)->ud->lastline) + 1; + if ((*it)->ud.lastline) + mem += strlen((*it)->ud.lastline) + 1; } for (bd = chan->bd; bd; bd = bd->next) { if (bd->mask) diff --git a/src/module.cpp b/src/module.cpp index 6aebd8644..70592112e 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -137,6 +137,7 @@ Module::~Module() } delete [] mhash->name; delete mhash; + break; } lastHash = mhash; } diff --git a/src/sockets.cpp b/src/sockets.cpp index 413b6873a..861cd26d8 100644 --- a/src/sockets.cpp +++ b/src/sockets.cpp @@ -371,7 +371,7 @@ void SocketEngine::Process() fd_set rfdset = ReadFDs, wfdset = WriteFDs, efdset = ReadFDs; timeval tval; - tval.tv_sec = 10; + tval.tv_sec = Config.ReadTimeout; tval.tv_usec = 0; int sresult = select(MaxFD + 1, &rfdset, &wfdset, &efdset, &tval); |