Ansariel 2021-01-26 09:33:27 +01:00
commit c823280b48
2 changed files with 31 additions and 10 deletions

View File

@ -895,16 +895,24 @@ void LLPluginProcessParent::poll(F64 timeout)
{
// timed out with no incoming data. Just return.
}
else if(status == EBADF)
// <FS:Beq> better logging of poll issues
// else if(status == EBADF)
else if(APR_STATUS_IS_EBADF(status))
{
// This happens when one of the file descriptors in the pollset is destroyed, which happens whenever a plugin's socket is closed.
// The pollset has been or will be recreated, so just return.
LL_DEBUGS("PluginPoll") << "apr_pollset_poll returned EBADF" << LL_ENDL;
}
else if(status != APR_SUCCESS)
// <FS:Beq> better logging of poll issues
// else if(status != APR_SUCCESS)
// {
// LL_WARNS("PluginPoll") << "apr_pollset_poll failed with status " << status << LL_ENDL;
// }
else
{
LL_WARNS("PluginPoll") << "apr_pollset_poll failed with status " << status << LL_ENDL;
LL_WARNS("PluginPoll") << "apr_pollset_poll failed with status " << status << " (" << APR_TO_OS_ERROR(status) << ")" << LL_ENDL;
}
// </FS:Beq>
}
// Remove instances in the done state from the sInstances map.

View File

@ -543,8 +543,11 @@ bool LLConversationLog::loadFromFile(const std::string& filename)
return false;
}
bool purge_required = false;
char buffer[MAX_STRING];
// <FS:Beq> FIRE-30705 protect against silly display names that cause lines to exceed max string length
// char buffer[MAX_STRING];
static constexpr int BUFFER_1K { 1024 }; // long enough to handle the most extreme Unicode nonsense and some to spare
char buffer[BUFFER_1K];
// </FS:Beq>
char conv_name_buffer[MAX_STRING];
char part_id_buffer[MAX_STRING];
char conv_id_buffer[MAX_STRING];
@ -555,12 +558,21 @@ bool LLConversationLog::loadFromFile(const std::string& filename)
// before CHUI-348 it was a flag of conversation voice state
int prereserved_unused;
while (!feof(fp) && fgets(buffer, MAX_STRING, fp))
// <FS:Beq/> FIRE-30705 protect against silly display names that cause lines to exceed max string length
// while (!feof(fp) && fgets(buffer, MAX_STRING, fp))
// {
// conv_name_buffer[0] = '\0';
// part_id_buffer[0] = '\0';
// conv_id_buffer[0] = '\0';
memset( buffer, '\0', BUFFER_1K );
while (!feof(fp) && fgets(buffer, BUFFER_1K, fp))
{
conv_name_buffer[0] = '\0';
part_id_buffer[0] = '\0';
conv_id_buffer[0] = '\0';
// force blank for added safety
memset( conv_name_buffer, '\0', MAX_STRING );
memset( part_id_buffer, '\0', MAX_STRING );
memset( conv_id_buffer, '\0', MAX_STRING );
memset( history_file_name, '\0', MAX_STRING );
// </FS:Beq>
sscanf(buffer, "[%lld] %d %d %d %[^|]| %s %s %[^|]|",
&time,
&stype,
@ -598,6 +610,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename)
}
mConversations.push_back(conversation);
memset( buffer, '\0', BUFFER_1K ); // <FS:Beq> FIRE-30705 clear buffer down
}
fclose(fp);