From: <ps...@us...> - 2008-08-21 10:46:59
|
Revision: 1161 http://znc.svn.sourceforge.net/znc/?rev=1161&view=rev Author: psychon Date: 2008-08-21 10:47:09 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Connect and reconnect faster to IRC The first reconnect now happens when the timer is created which is possibly thanks to latest Csocket. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2008-08-20 08:13:23 UTC (rev 1160) +++ trunk/znc.cpp 2008-08-21 10:47:09 UTC (rev 1161) @@ -1713,6 +1713,8 @@ SetName("Connect users"); Start(iSecs); m_uiPosNextUser = 0; + // Don't wait iSecs seconds for first timer run + m_bRunOnNextCall = true; } virtual ~CConnectUserTimer() {} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2008-09-12 12:54:52
|
Revision: 1196 http://znc.svn.sourceforge.net/znc/?rev=1196&view=rev Author: psychon Date: 2008-09-12 12:55:03 +0000 (Fri, 12 Sep 2008) Log Message: ----------- Small cleanup, removed two unused variables Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2008-09-10 14:24:07 UTC (rev 1195) +++ trunk/znc.cpp 2008-09-12 12:55:03 UTC (rev 1196) @@ -210,8 +210,6 @@ int CZNC::Loop() { while (true) { CString sError; - map<CString, CUser*>::iterator it; - map<CString, CUser*>::iterator end; if (GetNeedRehash()) { SetNeedRehash(false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2008-09-12 15:41:02
|
Revision: 1198 http://znc.svn.sourceforge.net/znc/?rev=1198&view=rev Author: psychon Date: 2008-09-12 15:41:12 +0000 (Fri, 12 Sep 2008) Log Message: ----------- Improve both, the code's and the debug output's easy-to-readyiness Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2008-09-12 15:35:46 UTC (rev 1197) +++ trunk/znc.cpp 2008-09-12 15:41:12 UTC (rev 1198) @@ -1753,18 +1753,27 @@ it++; m_uiPosNextUser = (m_uiPosNextUser + 1) % uiUserCount; - // Is this user disconnected and does he want to connect? - if (pUser->GetIRCSock() == NULL && pUser->GetIRCConnectEnabled()) { - // The timer runs until it once didn't find any users to connect - bUsersLeft = true; + // Is this user disconnected? + if (pUser->GetIRCSock() != NULL) + continue; - DEBUG_ONLY(cout << "Connecting user [" << pUser->GetUserName() - << "]" << endl); + // Does this user want to connect? + if (!pUser->GetIRCConnectEnabled()) + continue; - if (CZNC::Get().ConnectUser(pUser)) - // User connecting, wait until next time timer fires - return; - } + // Does this user have any servers? + if (!pUser->HasServers()) + continue; + + // The timer runs until it once didn't find any users to connect + bUsersLeft = true; + + DEBUG_ONLY(cout << "Connecting user [" << pUser->GetUserName() + << "]" << endl); + + if (CZNC::Get().ConnectUser(pUser)) + // User connecting, wait until next time timer fires + return; } if (bUsersLeft == false) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2008-10-11 15:43:43
|
Revision: 1246 http://znc.svn.sourceforge.net/znc/?rev=1246&view=rev Author: psychon Date: 2008-10-11 15:43:30 +0000 (Sat, 11 Oct 2008) Log Message: ----------- Make --makeconf check for znc.pem and generate it if it's missing This patch is based on ideas and an actual patch from the-me aka Patrick Matth?\195?\164i. Thanks. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2008-10-10 17:58:36 UTC (rev 1245) +++ trunk/znc.cpp 2008-10-11 15:43:30 UTC (rev 1246) @@ -571,6 +571,15 @@ #ifdef HAVE_LIBSSL if (CUtils::GetBoolInput("Would you like ZNC to listen using SSL?", false)) { sSSL = "+"; + + CString sPemFile = GetPemLocation(); + if (!CFile::Exists(sPemFile)) { + CUtils::PrintError("Unable to locate pem file: [" + sPemFile + "]"); + if (CUtils::GetBoolInput("Would you like to create a new pem file now?", + true)) { + WritePemFile(); + } + } } #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2008-12-21 17:10:28
|
Revision: 1299 http://znc.svn.sourceforge.net/znc/?rev=1299&view=rev Author: psychon Date: 2008-12-21 17:10:25 +0000 (Sun, 21 Dec 2008) Log Message: ----------- Don't append a slash to the paths returns from CZNC::Get*Path() The old versions didn't do this either and thus we used two slashes. While this doesn't hurt, it doesn't look good either. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2008-12-21 09:05:16 UTC (rev 1298) +++ trunk/znc.cpp 2008-12-21 17:10:25 UTC (rev 1299) @@ -441,7 +441,7 @@ } CString CZNC::GetConfPath() const { - CString sConfPath = m_sZNCPath + "/configs/"; + CString sConfPath = m_sZNCPath + "/configs"; if (!CFile::Exists(sConfPath)) { CDir::MakeDir(sConfPath); } @@ -450,7 +450,7 @@ } CString CZNC::GetUserPath() const { - CString sUserPath = m_sZNCPath + "/users/"; + CString sUserPath = m_sZNCPath + "/users"; if (!CFile::Exists(sUserPath)) { CDir::MakeDir(sUserPath); } @@ -459,7 +459,7 @@ } CString CZNC::GetModPath() const { - CString sModPath = m_sZNCPath + "/modules/"; + CString sModPath = m_sZNCPath + "/modules"; if (!CFile::Exists(sModPath)) { CDir::MakeDir(sModPath); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2009-01-25 11:12:44
|
Revision: 1346 http://znc.svn.sourceforge.net/znc/?rev=1346&view=rev Author: psychon Date: 2009-01-25 11:12:36 +0000 (Sun, 25 Jan 2009) Log Message: ----------- Check in CZNC::AddUser() if the username is still available Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2009-01-24 19:10:05 UTC (rev 1345) +++ trunk/znc.cpp 2009-01-25 11:12:36 UTC (rev 1346) @@ -1694,13 +1694,19 @@ } bool CZNC::AddUser(CUser* pUser, CString& sErrorRet) { - if (pUser->IsValid(sErrorRet)) { - m_msUsers[pUser->GetUserName()] = pUser; - return true; + if (FindUser(pUser->GetUserName()) != NULL) { + DEBUG_ONLY(cout << "User [" << pUser->GetUserName() << "]" + " - already exists" << endl); + return false; } + if (!pUser->IsValid(sErrorRet)) { + DEBUG_ONLY(cout << "Invalid user [" << pUser->GetUserName() << "]" + " - [" << sErrorRet << "]" << endl); + return false; + } + m_msUsers[pUser->GetUserName()] = pUser; + return true; - DEBUG_ONLY(cout << "Invalid user [" << pUser->GetUserName() << "] - [" << sErrorRet << "]" << endl); - return false; } CZNC& CZNC::Get() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2009-01-27 19:54:43
|
Revision: 1352 http://znc.svn.sourceforge.net/znc/?rev=1352&view=rev Author: psychon Date: 2009-01-27 19:54:38 +0000 (Tue, 27 Jan 2009) Log Message: ----------- Open the ISpoofFile with mode 'O_RDWR|O_CREAT' instead of '(int)true' This fixes a bug from r1337 Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2009-01-26 19:57:34 UTC (rev 1351) +++ trunk/znc.cpp 2009-01-27 19:54:38 UTC (rev 1352) @@ -248,7 +248,7 @@ if (!m_sISpoofFile.empty()) { m_pISpoofLockFile = new CFile; - if (!m_pISpoofLockFile->TryExLock(m_sISpoofFile, true)) { + if (!m_pISpoofLockFile->TryExLock(m_sISpoofFile, O_RDWR | O_CREAT)) { delete m_pISpoofLockFile; m_pISpoofLockFile = NULL; return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2009-03-01 16:44:05
|
Revision: 1406 http://znc.svn.sourceforge.net/znc/?rev=1406&view=rev Author: psychon Date: 2009-03-01 16:43:58 +0000 (Sun, 01 Mar 2009) Log Message: ----------- CZNC::AddUser(): Always set the error return on a useful value Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2009-03-01 13:07:11 UTC (rev 1405) +++ trunk/znc.cpp 2009-03-01 16:43:58 UTC (rev 1406) @@ -1702,6 +1702,7 @@ bool CZNC::AddUser(CUser* pUser, CString& sErrorRet) { if (FindUser(pUser->GetUserName()) != NULL) { + sErrorRet = "User already exists"; DEBUG("User [" << pUser->GetUserName() << "] - already exists"); return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2009-03-29 16:25:26
|
Revision: 1452 http://znc.svn.sourceforge.net/znc/?rev=1452&view=rev Author: psychon Date: 2009-03-29 16:25:17 +0000 (Sun, 29 Mar 2009) Log Message: ----------- Remove some unneeded stuff from the --makeconf code The ".so" suffix was already stripped in GetAvailableMods(). Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2009-03-29 12:23:59 UTC (rev 1451) +++ trunk/znc.cpp 2009-03-29 16:25:17 UTC (rev 1452) @@ -646,10 +646,6 @@ const CModInfo& Info = *it; CString sName = Info.GetName(); - if (sName.Right(3).Equals(".so")) { - sName.RightChomp(3); - } - if (CUtils::GetBoolInput("Load global module <\033[1m" + sName + "\033[22m>?", false)) { vsLines.push_back("LoadModule = " + sName); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2009-03-30 18:28:25
|
Revision: 1457 http://znc.svn.sourceforge.net/znc/?rev=1457&view=rev Author: psychon Date: 2009-03-30 18:28:09 +0000 (Mon, 30 Mar 2009) Log Message: ----------- Some changes to the code rewriting znc.conf Added some error checking and fixes a bug where the exclusive lock we use on the config file was removed. This was because we made the kernel allocate a new inode for the config while our lock was still on the old version of the config file. This should now be fixed. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2009-03-30 14:42:03 UTC (rev 1456) +++ trunk/znc.cpp 2009-03-30 18:28:09 UTC (rev 1457) @@ -482,13 +482,27 @@ } bool CZNC::WriteConfig() { + if (GetConfigFile().empty()) { + return false; + } + + // Close the old handle to the config file, we are replacing that file. + m_LockFile.Close(); + // We first write to a temporary file and then move it to the right place - CFile File(GetConfigFile() + "~"); + m_LockFile.SetFileName(GetConfigFile() + "~"); - if (GetConfigFile().empty() || !File.Open(O_WRONLY | O_CREAT | O_TRUNC, 0600)) { + if (!m_LockFile.Open(O_WRONLY | O_CREAT | O_TRUNC, 0600)) { return false; } + // We have to "transfer" our lock on the config to the new file. + // The old file (= inode) is going away and thus a lock on it would be + // useless. These lock should always succeed (races, anyone?). + if (!m_LockFile.TryExLock()) { + return false; + } + for (size_t l = 0; l < m_vpListeners.size(); l++) { CListener* pListener = m_vpListeners[l]; CString sHostPortion = pListener->GetBindHost(); @@ -499,31 +513,31 @@ CString s6 = (pListener->IsIPV6()) ? "6" : " "; - File.Write("Listen" + s6 + " = " + sHostPortion + CString((pListener->IsSSL()) ? "+" : "") + CString(pListener->GetPort()) + "\n"); + m_LockFile.Write("Listen" + s6 + " = " + sHostPortion + CString((pListener->IsSSL()) ? "+" : "") + CString(pListener->GetPort()) + "\n"); } - File.Write("ConnectDelay = " + CString(m_uiConnectDelay) + "\n"); + m_LockFile.Write("ConnectDelay = " + CString(m_uiConnectDelay) + "\n"); if (!m_sISpoofFile.empty()) { - File.Write("ISpoofFile = " + m_sISpoofFile.FirstLine() + "\n"); + m_LockFile.Write("ISpoofFile = " + m_sISpoofFile.FirstLine() + "\n"); if (!m_sISpoofFormat.empty()) { - File.Write("ISpoofFormat = " + m_sISpoofFormat.FirstLine() + "\n"); + m_LockFile.Write("ISpoofFormat = " + m_sISpoofFormat.FirstLine() + "\n"); } } if (!m_sPidFile.empty()) { - File.Write("PidFile = " + m_sPidFile.FirstLine() + "\n"); + m_LockFile.Write("PidFile = " + m_sPidFile.FirstLine() + "\n"); } if (!m_sStatusPrefix.empty()) { - File.Write("StatusPrefix = " + m_sStatusPrefix.FirstLine() + "\n"); + m_LockFile.Write("StatusPrefix = " + m_sStatusPrefix.FirstLine() + "\n"); } for (unsigned int m = 0; m < m_vsMotd.size(); m++) { - File.Write("Motd = " + m_vsMotd[m].FirstLine() + "\n"); + m_LockFile.Write("Motd = " + m_vsMotd[m].FirstLine() + "\n"); } for (unsigned int v = 0; v < m_vsVHosts.size(); v++) { - File.Write("VHost = " + m_vsVHosts[v].FirstLine() + "\n"); + m_LockFile.Write("VHost = " + m_vsVHosts[v].FirstLine() + "\n"); } #ifdef _MODULES @@ -537,7 +551,7 @@ sArgs = " " + sArgs.FirstLine(); } - File.Write("LoadModule = " + sName.FirstLine() + sArgs + "\n"); + m_LockFile.Write("LoadModule = " + sName.FirstLine() + sArgs + "\n"); } #endif @@ -549,19 +563,23 @@ continue; } - File.Write("\n"); + m_LockFile.Write("\n"); - if (!it->second->WriteConfig(File)) { + if (!it->second->WriteConfig(m_LockFile)) { DEBUG("** Error writing config for user [" << it->first << "]"); } } - File.Sync(); - File.Close(); + // If Sync() fails... well, let's hope nothing important breaks.. + m_LockFile.Sync(); // We wrote to a temporary name, move it to the right place - File.Move(GetConfigFile(), true); + if (!m_LockFile.Move(GetConfigFile(), true)) + return false; + // Everything went fine, just need to update the saved path. + m_LockFile.SetFileName(GetConfigFile()); + return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2009-04-07 06:48:55
|
Revision: 1483 http://znc.svn.sourceforge.net/znc/?rev=1483&view=rev Author: psychon Date: 2009-04-07 06:48:51 +0000 (Tue, 07 Apr 2009) Log Message: ----------- Print more useful error messages when binding a listening port fails Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2009-04-06 16:03:53 UTC (rev 1482) +++ trunk/znc.cpp 2009-04-07 06:48:51 UTC (rev 1483) @@ -1430,7 +1430,7 @@ CListener* pListener = new CListener(uPort, sBindHost, bSSL, bIPV6); if (!pListener->Listen()) { - sError = "Unable to bind"; + sError = "Unable to bind [" + CString(strerror(errno)) + "]"; CUtils::PrintStatus(false, sError); delete pListener; return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2009-07-06 16:25:33
|
Revision: 1557 http://znc.svn.sourceforge.net/znc/?rev=1557&view=rev Author: psychon Date: 2009-07-06 16:25:25 +0000 (Mon, 06 Jul 2009) Log Message: ----------- Fix a possible crash if users are deleted If a user is deleted while it is trying to connect to an IRC server, the IRC socket wasn't deleted together with the user. At some later point in time, the IRC socket will try to use the user object, which was already freed by now. Fix this by erasing IRC sockets together with their user object. Thanks to cnu for reporting this. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2009-07-04 12:54:15 UTC (rev 1556) +++ trunk/znc.cpp 2009-07-06 16:25:25 UTC (rev 1557) @@ -193,7 +193,9 @@ #endif m_msUsers.erase(pUser->GetUserName()); - CIRCSock* pIRCSock = pUser->GetIRCSock(); + // Don't use pUser->GetIRCSock(), as that only returns something if the + // CIRCSock is already connected, not when it's still connecting! + CIRCSock* pIRCSock = (CIRCSock*) m_Manager.FindSockByName("IRC::" + pUser->GetUserName()); if (pIRCSock) { m_Manager.DelSockByAddr(pIRCSock); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2009-10-20 16:53:30
|
Revision: 1652 http://znc.svn.sourceforge.net/znc/?rev=1652&view=rev Author: psychon Date: 2009-10-20 16:53:22 +0000 (Tue, 20 Oct 2009) Log Message: ----------- OnIRCConnecting(): Log abort-by-module Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2009-10-17 15:50:58 UTC (rev 1651) +++ trunk/znc.cpp 2009-10-20 16:53:22 UTC (rev 1652) @@ -167,6 +167,7 @@ MODULECALL(OnIRCConnecting(pIRCSock), pUser, NULL, DEBUG("Some module aborted the connection attempt"); + pUser->PutStatus("Some module aborted the connection attempt"); ReleaseISpoof(); delete pIRCSock; return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2009-11-29 15:17:55
|
Revision: 1670 http://znc.svn.sourceforge.net/znc/?rev=1670&view=rev Author: psychon Date: 2009-11-29 15:17:39 +0000 (Sun, 29 Nov 2009) Log Message: ----------- ISpoofFormat: Go through ExpandString() ISpoofFormat now can be used with e.g. %user% which allows some kind of poor-man's DenySetIdent (force ident to be user name). For backward compatibility, if ExpandString() doesn't change the string we just replace all "%" with the user's ident. Thanks to DarthGandalf for the idea and the patch. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2009-11-28 18:53:20 UTC (rev 1669) +++ trunk/znc.cpp 2009-11-29 15:17:39 UTC (rev 1670) @@ -287,7 +287,13 @@ return false; } - CString sData = m_sISpoofFormat.Token(0, false, "%") + pUser->GetIdent() + m_sISpoofFormat.Token(1, true, "%"); + CString sData = pUser->ExpandString(m_sISpoofFormat); + + // If the format doesn't contain anything expandable, we'll + // assume this is an "old"-style format string. + if (sData == m_sISpoofFormat) { + sData.Replace("%", pUser->GetIdent()); + } m_pISpoofLockFile->Write(sData + "\n"); } return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2009-12-18 16:59:42
|
Revision: 1679 http://znc.svn.sourceforge.net/znc/?rev=1679&view=rev Author: psychon Date: 2009-12-18 16:59:28 +0000 (Fri, 18 Dec 2009) Log Message: ----------- Restart the CConnectUserTimer after a rehash That way new ConnectDelay settings are applied immediately, not after the timer is restart next due to sth else. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2009-12-18 16:09:35 UTC (rev 1678) +++ trunk/znc.cpp 2009-12-18 16:59:28 UTC (rev 1679) @@ -1655,7 +1655,9 @@ return false; } - // Make sure that users that want to connect do so + // Make sure that users that want to connect do so and also make sure a + // new ConnectDelay setting is applied. + DisableConnectUser(); EnableConnectUser(); return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2010-03-09 16:47:14
|
Revision: 1817 http://znc.svn.sourceforge.net/znc/?rev=1817&view=rev Author: psychon Date: 2010-03-09 16:47:07 +0000 (Tue, 09 Mar 2010) Log Message: ----------- Use Listen and Listen4 in --makeconf Before this, --makeconf used "Listen" if you said "no" to "do you want ipv6?" and "Listen6" else. Since yesterday, "Listen" means "v4 and v6 please" (thanks to DarthGandalg) which means we now use "Listen4" for "no" and "Listen" else. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-03-08 17:23:53 UTC (rev 1816) +++ trunk/znc.cpp 2010-03-09 16:47:07 UTC (rev 1817) @@ -667,10 +667,10 @@ } #endif - CString s6 = " "; + CString s6 = "4"; #ifdef HAVE_IPV6 if (CUtils::GetBoolInput("Would you like ZNC to listen using ipv6?", false)) { - s6 = "6"; + s6 = " "; } #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cf...@us...> - 2010-03-10 01:35:55
|
Revision: 1821 http://znc.svn.sourceforge.net/znc/?rev=1821&view=rev Author: cflakes Date: 2010-03-10 01:35:47 +0000 (Wed, 10 Mar 2010) Log Message: ----------- Fix previous commit. That's why I said let psychon do it. Hahaha. Seriously though, why does stuff return TRUE when it fails and FALSE when everything's fine? Pretty weird. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-03-09 20:24:43 UTC (rev 1820) +++ trunk/znc.cpp 2010-03-10 01:35:47 UTC (rev 1821) @@ -1803,7 +1803,7 @@ << sErrorRet << "]"); return false; } - if (!GetModules().OnAddUser(*pUser, sErrorRet)) { + if (GetModules().OnAddUser(*pUser, sErrorRet)) { DEBUG("AddUser [" << pUser->GetUserName() << "] aborted by a module [" << sErrorRet << "]"); return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2010-03-10 13:28:22
|
Revision: 1822 http://znc.svn.sourceforge.net/znc/?rev=1822&view=rev Author: psychon Date: 2010-03-10 13:28:15 +0000 (Wed, 10 Mar 2010) Log Message: ----------- Change the default ConnectDelay from 30s to 5s Now that we have the new ServerThrottle, we should be able to live with this higher connect rate. Connecting lots of users is still awfully slow. :( Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-03-10 01:35:47 UTC (rev 1821) +++ trunk/znc.cpp 2010-03-10 13:28:15 UTC (rev 1822) @@ -33,7 +33,7 @@ m_pModules = new CGlobalModules(); m_pISpoofLockFile = NULL; - m_uiConnectDelay = 30; + m_uiConnectDelay = 5; m_uiAnonIPLimit = 10; SetISpoofFormat(""); // Set ISpoofFormat to default m_uBytesRead = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2010-04-01 08:42:04
|
Revision: 1867 http://znc.svn.sourceforge.net/znc/?rev=1867&view=rev Author: psychon Date: 2010-04-01 08:41:57 +0000 (Thu, 01 Apr 2010) Log Message: ----------- Entirely my fault, sorry :( Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-04-01 08:39:10 UTC (rev 1866) +++ trunk/znc.cpp 2010-04-01 08:41:57 UTC (rev 1867) @@ -1856,7 +1856,7 @@ for (it = m_vpListeners.begin(); it < m_vpListeners.end(); ++it) { if (*it == pListener) { m_vpListeners.erase(it); - delete *it; + delete pListener; return true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2010-05-01 11:36:48
|
Revision: 1957 http://znc.svn.sourceforge.net/znc/?rev=1957&view=rev Author: psychon Date: 2010-05-01 11:36:42 +0000 (Sat, 01 May 2010) Log Message: ----------- Add an alias for discon_kick discon_kick is now called disconkick, so load that one instead when we see a config line with "LoadModule = discon_kick". Idea by BrianC. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-04-30 18:15:50 UTC (rev 1956) +++ trunk/znc.cpp 2010-05-01 11:36:42 UTC (rev 1957) @@ -1427,6 +1427,13 @@ continue; } else if (sName.Equals("LoadModule")) { CString sModName = sValue.Token(0); + + // XXX Legacy crap, added in znc 0.089 + if (sModName == "discon_kick") { + CUtils::PrintMessage("NOTICE: [discon_kick] was renamed, loading [disconkick] instead"); + sModName = "disconkick"; + } + CUtils::PrintAction("Loading Module [" + sModName + "]"); CString sModRet; CString sArgs = sValue.Token(1, true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2010-05-10 17:45:21
|
Revision: 1977 http://znc.svn.sourceforge.net/znc/?rev=1977&view=rev Author: psychon Date: 2010-05-10 17:45:15 +0000 (Mon, 10 May 2010) Log Message: ----------- Add and use new config option "Listener" This is what each option does: Listen on ipv4 and ipv6: Listener, Listen6 Listen on ipv4 only: Listener4, Listen4, Listen Listen on ipv6 only: Listener6 Removed: ListenPort (not used since at least 0.047) (ZNC will only ever use Listener* by itself) This was done to preserve the old meaning of "Listen" and "Listen6", so that user configs don't break after update. Thanks to DarthGandalf for thinking about and implementing this. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-05-09 20:22:23 UTC (rev 1976) +++ trunk/znc.cpp 2010-05-10 17:45:15 UTC (rev 1977) @@ -575,7 +575,7 @@ break; } - m_LockFile.Write("Listen" + s6 + " = " + sAcceptProtocol + sHostPortion + + m_LockFile.Write("Listener" + s6 + " = " + sAcceptProtocol + sHostPortion + CString((pListener->IsSSL()) ? "+" : "") + CString(pListener->GetPort()) + "\n"); } @@ -695,7 +695,7 @@ sListenHost += " "; } - vsLines.push_back("Listen" + s6 + " = " + sListenHost + sSSL + CString(uListenPort)); + vsLines.push_back("Listener" + s6 + " = " + sListenHost + sSSL + CString(uListenPort)); // !Listen set<CModInfo> ssGlobalMods; @@ -1461,12 +1461,13 @@ } } } else { - if (sName.Equals("Listen") || sName.Equals("ListenPort") || sName.Equals("Listen6") || sName.Equals("Listen4")) { + if (sName.Equals("Listen") || sName.Equals("Listen6") || sName.Equals("Listen4") + || sName.Equals("Listener") || sName.Equals("Listener6") || sName.Equals("Listener4")) { EAddrType eAddr = ADDR_ALL; - if (sName.Equals("Listen4")) { + if (sName.Equals("Listen4") || sName.Equals("Listen") || sName.Equals("Listener4")) { eAddr = ADDR_IPV4ONLY; } - if (sName.Equals("Listen6")) { + if (sName.Equals("Listener6")) { eAddr = ADDR_IPV6ONLY; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2010-06-06 09:47:36
|
Revision: 2010 http://znc.svn.sourceforge.net/znc/?rev=2010&view=rev Author: psychon Date: 2010-06-06 09:47:30 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Allow leading/trailing spaces in the config This is especially useful for all those ASCII-art-in-the-MOTD guys. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-06-06 07:26:05 UTC (rev 2009) +++ trunk/znc.cpp 2010-06-06 09:47:30 UTC (rev 2010) @@ -1106,8 +1106,9 @@ while (File.ReadLine(sLine)) { uLineNum++; - // Remove all leading / trailing spaces and line endings - sLine.Trim(); + // Remove all leading spaces and trailing line endings + sLine.TrimLeft(); + sLine.TrimRight("\r\n"); if ((sLine.empty()) || (sLine[0] == '#') || (sLine.Left(2) == "//")) { continue; @@ -1251,8 +1252,15 @@ // If we have a regular line, figure out where it goes CString sName = sLine.Token(0, false, "="); CString sValue = sLine.Token(1, true, "="); + + // Only remove the first space, people might want + // leading spaces (e.g. in the MOTD). + if (sValue.Left(1) == " ") + sValue.LeftChomp(); + + // We don't have any names with spaces, trim all + // leading/trailing spaces. sName.Trim(); - sValue.Trim(); if ((!sName.empty()) && (!sValue.empty())) { if (pUser) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2010-06-13 07:58:34
|
Revision: 2025 http://znc.svn.sourceforge.net/znc/?rev=2025&view=rev Author: psychon Date: 2010-06-13 07:58:28 +0000 (Sun, 13 Jun 2010) Log Message: ----------- Write MaxBufferSize to the config r2020 added a new config option but forgot to actually write that setting back to the config. Whoops! Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-06-13 07:46:57 UTC (rev 2024) +++ trunk/znc.cpp 2010-06-13 07:58:28 UTC (rev 2025) @@ -548,6 +548,7 @@ } m_LockFile.Write("AnonIPLimit = " + CString(m_uiAnonIPLimit) + "\n"); + m_LockFile.Write("MaxBufferSize= " + CString(m_uiMaxBufferSize) + "\n"); for (size_t l = 0; l < m_vpListeners.size(); l++) { CListener* pListener = m_vpListeners[l]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2010-06-13 17:14:58
|
Revision: 2026 http://znc.svn.sourceforge.net/znc/?rev=2026&view=rev Author: psychon Date: 2010-06-13 17:14:52 +0000 (Sun, 13 Jun 2010) Log Message: ----------- Fix a NULL pointer dereference with traffic stats When something requested traffic statistics while there was an unauthenticated connection to ZNC, there was a NULL pointer dereference. Fix this by making the code saner and removing all NULL pointer dereferences. ;) Thanks to various people who reported this. A special thank you goes to Woet who helped debugging this. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-06-13 07:58:28 UTC (rev 2025) +++ trunk/znc.cpp 2010-06-13 17:14:52 UTC (rev 2026) @@ -1927,18 +1927,18 @@ } for (CSockManager::const_iterator it = m_Manager.begin(); it != m_Manager.end(); ++it) { + CUser *pUser = NULL; if ((*it)->GetSockName().Left(5) == "IRC::") { - CIRCSock *p = (CIRCSock *) *it; - ret[p->GetUser()->GetUserName()].first += p->GetBytesRead(); - ret[p->GetUser()->GetUserName()].second += p->GetBytesWritten(); - uiUsers_in += p->GetBytesRead(); - uiUsers_out += p->GetBytesWritten(); + pUser = ((CIRCSock *) *it)->GetUser(); } else if ((*it)->GetSockName().Left(5) == "USR::") { - CClient *p = (CClient *) *it; - ret[p->GetUser()->GetUserName()].first += p->GetBytesRead(); - ret[p->GetUser()->GetUserName()].second += p->GetBytesWritten(); - uiUsers_in += p->GetBytesRead(); - uiUsers_out += p->GetBytesWritten(); + pUser = ((CClient*) *it)->GetUser(); + } + + if (pUser) { + ret[pUser->GetUserName()].first += (*it)->GetBytesRead(); + ret[pUser->GetUserName()].second += (*it)->GetBytesWritten(); + uiUsers_in += (*it)->GetBytesRead(); + uiUsers_out += (*it)->GetBytesWritten(); } else { uiZNC_in += (*it)->GetBytesRead(); uiZNC_out += (*it)->GetBytesWritten(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cf...@us...> - 2010-06-27 01:15:21
|
Revision: 2045 http://znc.svn.sourceforge.net/znc/?rev=2045&view=rev Author: cflakes Date: 2010-06-27 01:15:14 +0000 (Sun, 27 Jun 2010) Log Message: ----------- Changed some text strings in --makeconf, idea & first patch by DGandalf, thanks Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-06-27 01:04:55 UTC (rev 2044) +++ trunk/znc.cpp 2010-06-27 01:15:14 UTC (rev 2045) @@ -751,6 +751,7 @@ // User CUtils::PrintMessage(""); CUtils::PrintMessage("Now we need to setup a user..."); + CUtils::PrintMessage("ZNC needs one user per IRC network."); CUtils::PrintMessage(""); bool bFirstUser = true; @@ -870,13 +871,13 @@ CUtils::GetInput("[" + sHost + "] Password (probably empty)", sPass); #ifdef HAVE_LIBSSL - bSSL = CUtils::GetBoolInput("Does this server use SSL? (probably no)", false); + bSSL = CUtils::GetBoolInput("Does this server use SSL?", false); #endif vsLines.push_back("\tServer = " + sHost + ((bSSL) ? " +" : " ") + CString(uServerPort) + " " + sPass); CUtils::PrintMessage(""); - } while (CUtils::GetBoolInput("Would you like to add another server?", false)); + } while (CUtils::GetBoolInput("Would you like to add another server for this IRC network?", false)); vsLines.push_back(""); CUtils::PrintMessage(""); @@ -900,7 +901,7 @@ CUtils::PrintMessage(""); bFirstUser = false; - } while (CUtils::GetBoolInput("Would you like to setup another user?", false)); + } while (CUtils::GetBoolInput("Would you like to setup another user (e.g. for connecting to another network)?", false)); // !User CFile File; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |