diff options
author | Monroe Linden <monroe@lindenlab.com> | 2010-04-27 17:25:01 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2010-04-27 17:25:01 -0700 |
commit | dacc5afbf0f1bde7454c1eadf56edb669d0741a9 (patch) | |
tree | 3b40360ef41c8c8d68ae1ef208d3aa304c3ba788 /indra/llplugin/llpluginprocesschild.cpp | |
parent | f1f07e66e3caaf4f633592f7d121c4b938899f49 (diff) |
Architectural changes to LLPlugin message processing.
LLPluginProcessParent can now optionally use a separate thread for reading messages from plugin sockets. If this is enabled, it will spawn a single thread and use apr_pollset_poll to wake up the thread when incoming data arrives instead of polling all the descriptors round-robin every frame. This should be somewhat more efficient, and should also allow blocking requests from plugins to be serviced much more quickly (once we start using them). This is currently disabled by default, until it's had a bit more focused testing on multiple platforms.
Hooked up the switch to use the message read thread to the PluginUseReadThread debug setting and an item in the Advanced menu in the viewer, and to a checkbox in the UI in llmediaplugintest.
Updated some debug logging in the plugin system to have appropriate tags and not log dire-looking warnings during normal operation.
LLPluginProcessParent now once again explicitly kills plugin processes (instead of just closing their sockets and waiting for them to exit). The problem we were attempting to solve by not doing the kill (letting the webkit plugin write its cookie file on exit) has been solved another way.
LLPluginProcessParent::sendMessage() now attempts to write the outgoing message to the socket immediately instead of waiting for the next frame. This should reduce the latency of sending plugin messages.
Added a separate fast timer for LLViewerMedia::updateMedia().
Diffstat (limited to 'indra/llplugin/llpluginprocesschild.cpp')
-rw-r--r-- | indra/llplugin/llpluginprocesschild.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index 2d078cd6ed..d1cf91b253 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -85,9 +85,14 @@ void LLPluginProcessChild::idle(void) bool idle_again; do { - if(mSocketError != APR_SUCCESS) + if(APR_STATUS_IS_EOF(mSocketError)) { - LL_INFOS("Plugin") << "message pipe is in error state, moving to STATE_ERROR"<< LL_ENDL; + // Plugin socket was closed. This covers both normal plugin termination and host crashes. + setState(STATE_ERROR); + } + else if(mSocketError != APR_SUCCESS) + { + LL_INFOS("Plugin") << "message pipe is in error state (" << mSocketError << "), moving to STATE_ERROR"<< LL_ENDL; setState(STATE_ERROR); } |