From: <ps...@us...> - 2010-12-30 21:11:46
|
Revision: 2221 http://znc.svn.sourceforge.net/znc/?rev=2221&view=rev Author: psychon Date: 2010-12-30 21:11:40 +0000 (Thu, 30 Dec 2010) Log Message: ----------- Improve debug output for ISpoof We now generate a DEBUG() message for all errors during ISpoof. Also, the message from *status "ISpoof could not be written" now includes the expanded ISpoofFile that we tried writing to. Modified Paths: -------------- trunk/znc.cpp Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-12-30 19:18:24 UTC (rev 2220) +++ trunk/znc.cpp 2010-12-30 21:11:40 UTC (rev 2221) @@ -137,8 +137,8 @@ return false; if (!WriteISpoof(pUser)) { - DEBUG("ISpoof could not be written"); - pUser->PutStatus("ISpoof could not be written, retrying..."); + DEBUG("ISpoof [" + m_sISpoofFile + "] could not be written"); + pUser->PutStatus("ISpoof [" + m_sISpoofFile + "] could not be written, retrying..."); return true; } @@ -258,6 +258,7 @@ if (!m_sISpoofFile.empty()) { m_pISpoofLockFile = new CFile; if (!m_pISpoofLockFile->TryExLock(m_sISpoofFile, O_RDWR | O_CREAT)) { + DEBUG("Couldn't open and lock ISpoofFile: " << strerror(errno)); delete m_pISpoofLockFile; m_pISpoofLockFile = NULL; return false; @@ -269,6 +270,7 @@ m_sOrigISpoof = buf; if (!m_pISpoofLockFile->Seek(0) || !m_pISpoofLockFile->Truncate()) { + DEBUG("Couldn't truncate the ISpoofFile: " << strerror(errno)); delete m_pISpoofLockFile; m_pISpoofLockFile = NULL; return false; @@ -281,6 +283,7 @@ if (sData == m_sISpoofFormat) { sData.Replace("%", pUser->GetIdent()); } + DEBUG("Writing [" + sData + "] to ISpoofFile [" + m_sISpoofFile + "]"); m_pISpoofLockFile->Write(sData + "\n"); } return true; @@ -292,7 +295,10 @@ if (!m_sISpoofFile.empty()) { if (m_pISpoofLockFile->Seek(0) && m_pISpoofLockFile->Truncate()) { + DEBUG("Writing [" + m_sOrigISpoof + "] to ISpoofFile [" + m_sISpoofFile + "]"); m_pISpoofLockFile->Write(m_sOrigISpoof); + } else { + DEBUG("Error while restoring ISpoof: " << strerror(errno)); } m_sOrigISpoof = ""; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |