[opensource-dev] Second Pair of eyes needed!
WolfPup Lowenhar
wolfpup67 at earthlink.net
Tue Aug 31 14:22:23 PDT 2010
Sorry folks as this might get a little long.
First Code Snip its:
1. see http://jira.secondlife.com/browse/VWR-20741 for reference to new
makeLofFileName in patch
2. std::string LLLogChat::oldLogFileName(std::string filename)
{
time_t now;
time_t yesterday = time(&now) - 86400;
char dbuffer[20]; /* Flawfinder: ignore */
if (filename == "chat")
{
strftime(dbuffer, 20, "-%Y-%m-%d", localtime(&yesterday));
}
else
{
strftime(dbuffer, 20, "-%Y-%m", localtime(&yesterday));
}
filename += dbuffer;
filename = cleanFileName(filename);
filename =
gDirUtilp->getExpandedFilename(LL_PATH_PER_ACCOUNT_CHAT_LOGS,filename);
filename += ".txt";
LL_INFOS("") << "Old :" << filename << LL_ENDL;
return filename;
}
3. std::string LLLogChat::ndsLogFileName(std::string filename)
{
filename = cleanFileName(filename);
filename =
gDirUtilp->getExpandedFilename(LL_PATH_PER_ACCOUNT_CHAT_LOGS,filename);
filename += ".txt";
LL_INFOS("") << "Original:" << filename << LL_ENDL;
return filename;
}
4. modified section of void LLLogChat::loadAllHistory(const std::string&
file_name, std::list<LLSD>& messages)
{
if (file_name.empty())
{
llwarns << "Session name is Empty!" << llendl;
return ;
}
LLFILE* fptr = LLFile::fopen(makeLogFileName(file_name), "r");
/*Flawfinder: ignore*/
LL_INFOS("") << "Current:" << file_name << LL_ENDL;
if (!fptr)
{
LLFILE* fptr = LLFile::fopen(oldLogFileName(filename), "r");
/*Flawfinder: ignore*/
LL_INFOS("") << "Old :" << file_name << LL_ENDL;
if (!fptr)
{
LLFILE* fptr =
LLFile::fopen(ndsLogFileName(file_name), "r"); /*Flawfinder:
ignore*/
LL_INFOS("") << "Orginal:" << file_name << LL_ENDL;
if (!fptr) return; //No previous conversation
with this name.
}
}
LL_INFOS("") << "Reading:" << file_name << LL_ENDL;
char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/
char *bptr;
S32 len;
bool firstline = TRUE;
if (fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END))
Problem:
When I get done with locating the right named log file and got to read it I
am ending up with fptr being null and causing viewer lock up and hard crash.
More information about the opensource-dev
mailing list