bonefish+mmlr:
* Move most of MIME database support out of libbe and into registrar * Use the (async) MessageDeliverer instead of a synchronous SendMessage in _SendMonitorUpdate This fixes a deadlock when the message port of a MIME database watching application gets full as documented in bug #1311. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23423 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8d2dd6d32f
commit
f82c11c079
@ -45,17 +45,6 @@ MergeObject <libbe>storage_kit.o :
|
|||||||
storage_support.cpp
|
storage_support.cpp
|
||||||
|
|
||||||
# mime
|
# mime
|
||||||
AssociatedTypes.cpp
|
|
||||||
CreateAppMetaMimeThread.cpp
|
|
||||||
Database.cpp
|
|
||||||
InstalledTypes.cpp
|
|
||||||
MimeSnifferAddon.cpp
|
|
||||||
MimeSnifferAddonManager.cpp
|
|
||||||
MimeUpdateThread.cpp
|
|
||||||
SnifferRules.cpp
|
|
||||||
Supertype.cpp
|
|
||||||
SupportingApps.cpp
|
|
||||||
UpdateMimeInfoThread.cpp
|
|
||||||
database_access.cpp
|
database_access.cpp
|
||||||
database_support.cpp
|
database_support.cpp
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ UsePrivateHeaders storage ;
|
|||||||
UsePrivateHeaders tracker ;
|
UsePrivateHeaders tracker ;
|
||||||
UseArchHeaders $(TARGET_ARCH) ;
|
UseArchHeaders $(TARGET_ARCH) ;
|
||||||
|
|
||||||
|
SEARCH_SOURCE += [ FDirName $(SUBDIR) mime ] ;
|
||||||
|
|
||||||
Server registrar
|
Server registrar
|
||||||
:
|
:
|
||||||
AppInfoList.cpp
|
AppInfoList.cpp
|
||||||
@ -33,6 +35,19 @@ Server registrar
|
|||||||
TRoster.cpp
|
TRoster.cpp
|
||||||
Watcher.cpp
|
Watcher.cpp
|
||||||
WatchingService.cpp
|
WatchingService.cpp
|
||||||
|
|
||||||
|
# mime
|
||||||
|
AssociatedTypes.cpp
|
||||||
|
CreateAppMetaMimeThread.cpp
|
||||||
|
Database.cpp
|
||||||
|
InstalledTypes.cpp
|
||||||
|
MimeSnifferAddon.cpp
|
||||||
|
MimeSnifferAddonManager.cpp
|
||||||
|
MimeUpdateThread.cpp
|
||||||
|
SnifferRules.cpp
|
||||||
|
Supertype.cpp
|
||||||
|
SupportingApps.cpp
|
||||||
|
UpdateMimeInfoThread.cpp
|
||||||
:
|
:
|
||||||
be
|
be
|
||||||
$(TARGET_LIBSTDC++)
|
$(TARGET_LIBSTDC++)
|
||||||
|
@ -1,26 +1,27 @@
|
|||||||
// MIMEManager.cpp
|
// MIMEManager.cpp
|
||||||
|
|
||||||
|
#include "MIMEManager.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
#include <ClassInfo.h>
|
#include <ClassInfo.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
#include <mime/CreateAppMetaMimeThread.h>
|
|
||||||
#include <mime/MimeSnifferAddonManager.h>
|
|
||||||
#include <mime/UpdateMimeInfoThread.h>
|
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <RegistrarDefs.h>
|
#include <RegistrarDefs.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <TypeConstants.h>
|
#include <TypeConstants.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include "CreateAppMetaMimeThread.h"
|
||||||
#include <string>
|
#include "MimeSnifferAddonManager.h"
|
||||||
|
#include "TextSnifferAddon.h"
|
||||||
|
#include "UpdateMimeInfoThread.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace BPrivate;
|
using namespace BPrivate;
|
||||||
|
|
||||||
#include "MIMEManager.h"
|
|
||||||
#include "TextSnifferAddon.h"
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class MIMEManager
|
\class MIMEManager
|
||||||
\brief MIMEManager handles communication between BMimeType and the system-wide
|
\brief MIMEManager handles communication between BMimeType and the system-wide
|
||||||
|
@ -4,9 +4,10 @@
|
|||||||
#define MIME_MANAGER_H
|
#define MIME_MANAGER_H
|
||||||
|
|
||||||
#include <Looper.h>
|
#include <Looper.h>
|
||||||
#include <mime/Database.h>
|
|
||||||
#include <RegistrarThreadManager.h>
|
#include <RegistrarThreadManager.h>
|
||||||
|
|
||||||
|
#include "Database.h"
|
||||||
|
|
||||||
class MIMEManager : public BLooper {
|
class MIMEManager : public BLooper {
|
||||||
public:
|
public:
|
||||||
MIMEManager();
|
MIMEManager();
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
AssociatedTypes class implementation
|
AssociatedTypes class implementation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mime/AssociatedTypes.h"
|
#include "AssociatedTypes.h"
|
||||||
|
#include "MimeSnifferAddonManager.h"
|
||||||
|
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
@ -16,7 +17,6 @@
|
|||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <mime/database_support.h>
|
#include <mime/database_support.h>
|
||||||
#include <mime/MimeSnifferAddonManager.h>
|
|
||||||
#include <storage_support.h>
|
#include <storage_support.h>
|
||||||
|
|
||||||
#include <new>
|
#include <new>
|
@ -8,8 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "mime/CreateAppMetaMimeThread.h"
|
#include "CreateAppMetaMimeThread.h"
|
||||||
#include "mime/database_support.h"
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <AppFileInfo.h>
|
#include <AppFileInfo.h>
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
@ -19,8 +20,7 @@
|
|||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <mime/database_support.h>
|
||||||
|
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
namespace Storage {
|
namespace Storage {
|
@ -10,7 +10,7 @@
|
|||||||
#ifndef _CREATE_APP_META_MIME_THREAD_H
|
#ifndef _CREATE_APP_META_MIME_THREAD_H
|
||||||
#define _CREATE_APP_META_MIME_THREAD_H
|
#define _CREATE_APP_META_MIME_THREAD_H
|
||||||
|
|
||||||
#include <mime/MimeUpdateThread.h>
|
#include "MimeUpdateThread.h"
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
namespace Storage {
|
namespace Storage {
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <mime/Database.h>
|
#include "Database.h"
|
||||||
|
|
||||||
#include <mime/database_access.h>
|
#include <mime/database_access.h>
|
||||||
#include <mime/database_support.h>
|
#include <mime/database_support.h>
|
||||||
@ -34,6 +34,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "MessageDeliverer.h"
|
||||||
|
|
||||||
//#define DBG(x) x
|
//#define DBG(x) x
|
||||||
#define DBG(x)
|
#define DBG(x)
|
||||||
@ -1374,9 +1375,9 @@ Database::_SendMonitorUpdate(BMessage &msg)
|
|||||||
status_t err;
|
status_t err;
|
||||||
std::set<BMessenger>::const_iterator i;
|
std::set<BMessenger>::const_iterator i;
|
||||||
for (i = fMonitorMessengers.begin(); i != fMonitorMessengers.end(); i++) {
|
for (i = fMonitorMessengers.begin(); i != fMonitorMessengers.end(); i++) {
|
||||||
status_t err = (*i).SendMessage(&msg, (BHandler*)NULL);
|
status_t err = MessageDeliverer::Default()->DeliverMessage(&msg, *i);
|
||||||
if (err) {
|
if (err) {
|
||||||
DBG(OUT("Database::_SendMonitorUpdate(BMessage&): BMessenger::SendMessage failed, 0x%lx\n", err));
|
DBG(OUT("Database::_SendMonitorUpdate(BMessage&): DeliverMessage failed, 0x%lx\n", err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// DBG(OUT("Database::_SendMonitorUpdate(BMessage&) done\n"));
|
// DBG(OUT("Database::_SendMonitorUpdate(BMessage&) done\n"));
|
@ -8,19 +8,21 @@
|
|||||||
#ifndef _MIME_DATABASE_H
|
#ifndef _MIME_DATABASE_H
|
||||||
#define _MIME_DATABASE_H
|
#define _MIME_DATABASE_H
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <Mime.h>
|
#include <Mime.h>
|
||||||
#include <mime/AssociatedTypes.h>
|
|
||||||
#include <mime/InstalledTypes.h>
|
|
||||||
#include <mime/SnifferRules.h>
|
|
||||||
#include <mime/SupportingApps.h>
|
|
||||||
#include <mime/database_access.h>
|
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
#include <StorageDefs.h>
|
#include <StorageDefs.h>
|
||||||
|
|
||||||
#include <string>
|
#include <mime/database_access.h>
|
||||||
#include <map>
|
|
||||||
#include <set>
|
#include "AssociatedTypes.h"
|
||||||
|
#include "InstalledTypes.h"
|
||||||
|
#include "SnifferRules.h"
|
||||||
|
#include "SupportingApps.h"
|
||||||
|
|
||||||
|
|
||||||
class BNode;
|
class BNode;
|
||||||
class BBitmap;
|
class BBitmap;
|
@ -9,7 +9,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "mime/InstalledTypes.h"
|
#include "InstalledTypes.h"
|
||||||
|
|
||||||
#include <mime/database_support.h>
|
#include <mime/database_support.h>
|
||||||
#include <storage_support.h>
|
#include <storage_support.h>
|
||||||
|
|
@ -10,8 +10,7 @@
|
|||||||
#ifndef _MIME_INSTALLED_TYPES_H
|
#ifndef _MIME_INSTALLED_TYPES_H
|
||||||
#define _MIME_INSTALLED_TYPES_H
|
#define _MIME_INSTALLED_TYPES_H
|
||||||
|
|
||||||
|
#include "Supertype.h"
|
||||||
#include <mime/Supertype.h>
|
|
||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
@ -3,7 +3,7 @@
|
|||||||
* All rights reserved. Distributed under the terms of the MIT License.
|
* All rights reserved. Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <MimeSnifferAddon.h>
|
#include "MimeSnifferAddon.h"
|
||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
BMimeSnifferAddon::BMimeSnifferAddon()
|
BMimeSnifferAddon::BMimeSnifferAddon()
|
@ -3,14 +3,15 @@
|
|||||||
* All rights reserved. Distributed under the terms of the MIT License.
|
* All rights reserved. Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mime/MimeSnifferAddonManager.h>
|
#include "MimeSnifferAddonManager.h"
|
||||||
|
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
#include <Autolock.h>
|
#include <Autolock.h>
|
||||||
#include <MimeSnifferAddon.h>
|
|
||||||
#include <MimeType.h>
|
#include <MimeType.h>
|
||||||
|
|
||||||
|
#include "MimeSnifferAddon.h"
|
||||||
|
|
||||||
using std::nothrow;
|
using std::nothrow;
|
||||||
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
|||||||
MimeUpdateThread implementation
|
MimeUpdateThread implementation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "MimeUpdateThread.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
@ -21,7 +23,6 @@
|
|||||||
#include <Volume.h>
|
#include <Volume.h>
|
||||||
|
|
||||||
#include <storage_support.h>
|
#include <storage_support.h>
|
||||||
#include "mime/MimeUpdateThread.h"
|
|
||||||
|
|
||||||
//#define DBG(x) x
|
//#define DBG(x) x
|
||||||
#define DBG(x)
|
#define DBG(x)
|
@ -12,22 +12,23 @@
|
|||||||
SnifferRules class implementation
|
SnifferRules class implementation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mime/SnifferRules.h"
|
#include "SnifferRules.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <MimeType.h>
|
#include <MimeType.h>
|
||||||
#include <mime/database_support.h>
|
#include <mime/database_support.h>
|
||||||
#include <mime/MimeSnifferAddonManager.h>
|
|
||||||
#include <sniffer/Parser.h>
|
#include <sniffer/Parser.h>
|
||||||
#include <sniffer/Rule.h>
|
#include <sniffer/Rule.h>
|
||||||
#include <StorageDefs.h>
|
#include <StorageDefs.h>
|
||||||
#include <storage_support.h>
|
#include <storage_support.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include "MimeSnifferAddonManager.h"
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
#define DBG(x) x
|
#define DBG(x) x
|
||||||
//#define DBG(x)
|
//#define DBG(x)
|
@ -7,7 +7,7 @@
|
|||||||
Supertype class implementation
|
Supertype class implementation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mime/Supertype.h"
|
#include "Supertype.h"
|
||||||
|
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <mime/database_support.h>
|
#include <mime/database_support.h>
|
@ -9,7 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <mime/SupportingApps.h>
|
#include "SupportingApps.h"
|
||||||
#include <mime/database_support.h>
|
#include <mime/database_support.h>
|
||||||
|
|
||||||
#include <storage_support.h>
|
#include <storage_support.h>
|
@ -7,7 +7,7 @@
|
|||||||
UpdateMimeInfoThread implementation
|
UpdateMimeInfoThread implementation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mime/UpdateMimeInfoThread.h"
|
#include "UpdateMimeInfoThread.h"
|
||||||
|
|
||||||
#include <AppFileInfo.h>
|
#include <AppFileInfo.h>
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
@ -10,7 +10,7 @@
|
|||||||
#ifndef _MIME_UPDATE_MIME_INFO_THREAD_H
|
#ifndef _MIME_UPDATE_MIME_INFO_THREAD_H
|
||||||
#define _MIME_UPDATE_MIME_INFO_THREAD_H
|
#define _MIME_UPDATE_MIME_INFO_THREAD_H
|
||||||
|
|
||||||
#include <mime/MimeUpdateThread.h>
|
#include "MimeUpdateThread.h"
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
namespace Storage {
|
namespace Storage {
|
Loading…
Reference in New Issue
Block a user